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 #
Future<int> count(
String index,
String collection,
{
Map<String, dynamic> query = const {}
})
Argument | Type | Description |
---|---|---|
index | String | Index name |
collection | String | Collection name |
query | Map<String, dynamic> ( {} ) | Query to match |
Return #
Returns an int.
Usage #
final result = await kuzzle
.document
.count('nyc-open-data', 'yellow-taxi', query: {
'query': {
'match': {
'Hello': 'Clarisse',
},
},
});
Edit this page on Github(opens new window)