// 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.search({
  index: "node_upgrade",
  size: 0,
  aggs: {
    startup_time_ttest: {
      t_test: {
        a: {
          field: "startup_time_before",
          filter: {
            term: {
              group: "A",
            },
          },
        },
        b: {
          field: "startup_time_before",
          filter: {
            term: {
              group: "B",
            },
          },
        },
        type: "heteroscedastic",
      },
    },
  },
});
console.log(response);
----
