Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 1.94 KB

File metadata and controls

50 lines (34 loc) · 1.94 KB
code type title description
true
page
updateByQuery
Updates documents matching query

updateByQuery

Updates documents matching the provided search query.

Kuzzle uses the ElasticSearch Query DSL syntax.

An empty or null query will match all documents in the collection.


updateByQuery(index, collection, query, changes, [options])
Argument Type Description
index
string
Index name
collection
string
Collection name
query
object
Query to match
changes
object
Partial changes to apply to the documents
options
object
Optional parameters

options

Additional query options.

Options Type
(default)
Description
refresh
string

("")
If set to wait_for, waits for the change to be reflected for search (up to 1s)
timeout
number
Time (in ms) during which a request will still be waited to be resolved. Set it -1 if you want to wait indefinitely

Resolves

Returns the number of updated documents.

Usage

<<< ./snippets/update-by-query.js