1. String to BsonDocument

string json = "{ 'foo' : 'bar' }";

MongoDB.Bson.BsonDocument document

= MongoDB.Bson.Serialization.BsonSerializer.Deserialize<BsonDocument>(json);

 

  1. BsonDocument to json string.

    BsonDocument.ToJson()

posted on 2018-01-24 17:06  今夜太冷  阅读(13026)  评论(0编辑  收藏  举报