// 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.nodes.stats({
  metric: "indices",
  index_metric: "fielddata",
  fields: "field1,field2",
});
console.log(response);

const response1 = await client.nodes.stats({
  metric: "indices",
  index_metric: "fielddata",
  level: "indices",
  fields: "field1,field2",
});
console.log(response1);

const response2 = await client.nodes.stats({
  metric: "indices",
  index_metric: "fielddata",
  level: "shards",
  fields: "field1,field2",
});
console.log(response2);

const response3 = await client.nodes.stats({
  metric: "indices",
  index_metric: "fielddata",
  fields: "field*",
});
console.log(response3);
----
