count method
Counts documents in a data collection
.
A query
can be provided to alter the count result,
otherwise returns the total number of documents in the data collection.
Implementation
Future<int> count(String index, String collection,
{Map<String, dynamic> query = const {}}) async {
final response = await kuzzle.query(KuzzleRequest(
controller: name,
action: 'count',
index: index,
collection: collection,
body: query,
));
return response.result['count'] as int;
}