getDocRefById method

DocRefMemory? getDocRefById(
  1. String docId
)

Implementation

DocRefMemory? getDocRefById(
  String docId,
) {
  String collId = _id;
  if (_memoryDb[collId] == null) return null;
  Map<String, dynamic>? doc = _memoryDb[collId]!.cast().firstWhere(
        (doc) => doc[DBRKeys.id] == docId,
        orElse: () => null,
      );
  if (doc == null) {
    return null;
  } else {
    String docId = doc[DBRKeys.id];
    return DocRefMemory(docId, _collRefMemory, _memoryDb);
  }
}