22 lines
397 B
Plaintext
22 lines
397 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.update({
|
|
index: "test",
|
|
id: 1,
|
|
script: {
|
|
source: "ctx._source.counter += params.count",
|
|
lang: "painless",
|
|
params: {
|
|
count: 4,
|
|
},
|
|
},
|
|
upsert: {
|
|
counter: 1,
|
|
},
|
|
});
|
|
console.log(response);
|
|
----
|