parse static method

MongoDocument parse(
  1. dynamic data
)

Parses a string in MongoDB Extended JSON format to a Document

Implementation

static MongoDocument parse(data) {
  Map<String, dynamic> map = json.decode(data);

  map.forEach((key, value) {
    if (value is LinkedHashMap || value is Map) {
      map[key] = fixMapMismatchedTypes(value);
    }
  });

  return MongoDocument(map);
}