getCount method

Future<int> getCount({
  1. String? field,
  2. Object? value,
  3. Map<String, Object?>? filter,
})

Implementation

Future<int> getCount({
  String? field,
  Object? value,
  Map<String, Object?>? filter,
}) async {
  if (field != null && value != null) {
    var count = await collection.modernCount(
        selector: where.eq(field, value), filter: filter);
    return count.count;
  }
  return (await collection.modernCount(filter: filter)).count;
}