updateByQuery method
Updates documents matching the provided search query. Documents updated that way trigger real-time notifications.
Limitations
The request fails if the number of documents returned by the search query exceeds the documentsWriteCount server configuration (see the Configuring Kuzzle guide).
update a greater number of documents, either change the server configuration, or split the search query.
Implementation
Future<Map<String, dynamic>> updateByQuery(String index, String collection,
{required Map<String, dynamic> searchQuery,
required Map<String, dynamic> changes,
bool waitForRefresh = false,
bool source = false,
String? lang}) async {
final response = await kuzzle.query(KuzzleRequest(
controller: name,
action: 'updateByQuery',
index: index,
collection: collection,
body: {'query': searchQuery, 'changes': changes},
waitForRefresh: waitForRefresh,
source: source,
lang: lang,
));
return response.result as Map<String, dynamic>;
}