SDK
SDK Dart v1.x
2

# deleteByQuery

Deletes 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.

Copied to clipboard!
Future<List<String> deleteByQuery(
    String index,
    String collection,
    Map<String, dynamic> query, {
    bool waitForRefresh = false,
  })
Argument Type Description
index
String
Index name
collection
String
Collection name
searchQuery
Map<String, dynamic>
Query to match
waitForRefresh
bool

(false)
If set to true, Kuzzle will wait for the persistence layer to finish indexing

# Returns

Returns a List<String> containing the deleted document ids.

# Usage

Copied to clipboard!
final result = await kuzzle
  .document
  .deleteByQuery('nyc-open-data', 'yellow-taxi', {
    'query': {
      'match': {
        'capacity': 4
      }
    }
  });