Files
elasticsearch-js/docs/doc_examples/7d3a74fe0ba3fe95d1c3275365ff9315.asciidoc
Elastic Machine 9479d82644 Auto-generated code for 8.16 (#2410)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-10-28 15:11:56 -05:00

51 lines
800 B
Plaintext

// 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.create({
index: "idx",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
flattened: {
type: "flattened",
},
},
},
});
console.log(response);
const response1 = await client.index({
index: "idx",
id: 1,
document: {
flattened: {
field: [
{
id: 1,
name: "foo",
},
{
id: 2,
name: "bar",
},
{
id: 3,
name: "baz",
},
],
},
},
});
console.log(response1);
----