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

[source, js]
----
const response = await client.index({
  index: "products",
  id: 1567,
  if_seq_no: 362,
  if_primary_term: 2,
  document: {
    product: "r2d2",
    details: "A resourceful astromech droid",
    tags: ["droid"],
  },
});
console.log(response);
----
