// 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.bulk({
  index: "metrics-weather_sensors-dev",
  operations: [
    {
      create: {},
    },
    {
      "@timestamp": "2099-05-06T16:21:15.000Z",
      sensor_id: "HAL-000001",
      location: "plains",
      temperature: 26.7,
      humidity: 49.9,
    },
    {
      create: {},
    },
    {
      "@timestamp": "2099-05-06T16:25:42.000Z",
      sensor_id: "SYKENET-000001",
      location: "swamp",
      temperature: 32.4,
      humidity: 88.9,
    },
  ],
});
console.log(response);

const response1 = await client.index({
  index: "metrics-weather_sensors-dev",
  document: {
    "@timestamp": "2099-05-06T16:21:15.000Z",
    sensor_id: "SYKENET-000001",
    location: "swamp",
    temperature: 32.4,
    humidity: 88.9,
  },
});
console.log(response1);
----
