Skip to content

Commit 874b524

Browse files
ArtemBernatskyyhonzakral
authored andcommitted
Added example with how to use variables in UpdateByQuery.script()
1 parent 43c71ce commit 874b524

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/update_by_query.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ explicitly:
8080
8181
print(ubq.to_dict())
8282
83+
Also, to use variables in script see below example:
84+
85+
.. code:: python
86+
87+
ubq.script(
88+
source="ctx._source.messages.removeIf(x -> x.somefield == params.some_var)",
89+
params={
90+
'some_var': 'some_string_val'
91+
}
92+
)
93+
8394
Serialization and Deserialization
8495
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8596

0 commit comments

Comments
 (0)