count method
Counts documents
Implementation
Future<int> count(
String collection, {
Map<String, dynamic>? filter,
}) async {
final response = await _client.post(
Uri.parse('$baseUrl/collections/$collection/count'),
headers: _headers,
body: jsonEncode({
if (filter != null) 'filter': filter,
}),
);
final data = _handleResponse(response);
return data['count'] as int? ?? 0;
}