// 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.indices.modifyDataStream({
  actions: [
    {
      remove_backing_index: {
        data_stream: "my-logs",
        index: ".ds-my-logs-2099.01.01-000001",
      },
    },
    {
      add_backing_index: {
        data_stream: "my-logs",
        index: "index-to-add",
      },
    },
  ],
});
console.log(response);
----
