SDK
SDK Dart v2.x
2

count #

Counts documents in a collection.

A query can be provided to alter the count result, otherwise returns the total number of documents in the collection.

Kuzzle uses the ElasticSearch Query DSL syntax.


Arguments #

Copied to clipboard!
Future<int> count(
    String index,
    String collection,
    {
    Map<String, dynamic> query
})

Argument Type Description
index
String
Index name
collection
String
Collection name
query
Map<String, dynamic>

({})
Query to match

Return #

Returns an int.

Usage #

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