// 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.asyncSearch.submit({
  index: "sales*",
  size: 0,
  sort: [
    {
      date: {
        order: "asc",
      },
    },
  ],
  aggs: {
    sale_date: {
      date_histogram: {
        field: "date",
        calendar_interval: "1d",
      },
    },
  },
});
console.log(response);
----
