extractEJson static method
Implementation
static DBPointerData extractEJson(Map<String, dynamic> eJsonMap) {
var entry = eJsonMap.entries.first;
if (entry.key != type$dbPointer) {
throw ArgumentError(
'The received Map is not a avalid EJson DbPointer representation');
}
var content = entry.value;
if (content.containsKey(type$ref) && content.containsKey(type$id)) {
String locCollection = content[type$ref] as String;
var locBsonObjectId =
BsonObjectId.fromEJson(content[type$id] as Map<String, Object>);
return DBPointerData(
locCollection, locBsonObjectId, BsonString(locCollection));
}
throw ArgumentError(
'The received Map is not a valid EJson Timestamp representation');
}