deleteByQuery method

Future<List<String>> deleteByQuery(
  1. String index,
  2. String collection,
  3. Map<String, dynamic> query, {
  4. bool waitForRefresh = false,
  5. String? lang,
})

Deletes documents matching the provided search query.

Implementation

Future<List<String>> deleteByQuery(
    String index, String collection, Map<String, dynamic> query,
    {bool waitForRefresh = false, String? lang}) async {
  final response = await kuzzle.query(KuzzleRequest(
    controller: name,
    action: 'deleteByQuery',
    index: index,
    collection: collection,
    body: query,
    waitForRefresh: waitForRefresh,
    lang: lang,
  ));

  return List<String>.from(response.result['ids'] as List<dynamic>);
}