25 lines
428 B
Plaintext
25 lines
428 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',
|
|
body: {
|
|
script: {
|
|
source: 'ctx._source.counter += params.count',
|
|
lang: 'painless',
|
|
params: {
|
|
count: 4
|
|
}
|
|
},
|
|
upsert: {
|
|
counter: 1
|
|
}
|
|
}
|
|
})
|
|
console.log(response)
|
|
----
|
|
|