deserialize static method

Map<String, dynamic> deserialize(
  1. BsonBinary buffer, {
  2. bool relaxed = false,
})

Converts a serialized document to ejson format map.

Implementation

static Map<String, dynamic> deserialize(BsonBinary buffer,
    {bool relaxed = false}) {
  buffer.offset = 0;
  if (buffer.byteList.length < 5) {
    throw Exception('corrupt bson message < 5 bytes long');
  }
  return BsonMap.fromBuffer(buffer).eJson(relaxed: relaxed);
}