// 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.indices.create({
  index: "bad_example_index",
  mappings: {
    properties: {
      field_1: {
        type: "text",
        copy_to: "field_2",
      },
      field_2: {
        type: "text",
        copy_to: "field_3",
      },
      field_3: {
        type: "text",
      },
    },
  },
});
console.log(response);
----
