// 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.putIndexTemplate({
  name: "new-data-stream-template",
  index_patterns: ["new-data-stream*"],
  data_stream: {},
  priority: 500,
  template: {
    mappings: {
      properties: {
        "@timestamp": {
          type: "date_nanos",
        },
      },
    },
    settings: {
      "sort.field": ["@timestamp"],
      "sort.order": ["desc"],
    },
  },
});
console.log(response);
----
