findOne method
Implementation
Map<String, dynamic>? findOne(bool Function(dynamic) predicate) {
final List<Map<String, dynamic>> documents =
List<Map<String, dynamic>>.from(
collection.values.where(predicate).toList());
return documents.isNotEmpty ? documents.first : null;
}