count method

int count({
  1. Map<String, dynamic>? query,
})

Implementation

int count({Map<String, dynamic>? query}) {
  if (query == null) {
    return collection.length;
  } else {
    int count = 0;
    for (final doc in collection.values) {
      if (_matchWithOperators(doc, query)) {
        count++;
      }
    }
    return count;
  }
}