// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.mjs` to generate the docs examples

[source, js]
----
const response = await client.index({
  index: "my_index",
  id: 1,
  document: {
    my_text: "histogram_1",
    my_histogram: {
      values: [0.1, 0.2, 0.3, 0.4, 0.5],
      counts: [3, 7, 23, 12, 6],
    },
    _doc_count: 45,
  },
});
console.log(response);

const response1 = await client.index({
  index: "my_index",
  id: 2,
  document: {
    my_text: "histogram_2",
    my_histogram: {
      values: [0.1, 0.25, 0.35, 0.4, 0.45, 0.5],
      counts: [8, 17, 8, 7, 6, 2],
    },
    _doc_count: 62,
  },
});
console.log(response1);
----
