Convert MongoDB BsonDocument into a string
How do a convert an entire MongoDB BsonDocument into 开发者_JAVA百科a string?
(I'm using the official C# driver)
You can convert BsonDocument into a JSON formatted string using MongoDB.Bson.BsonExtensionMethods.ToJson
.
Code used shown below:
string rc = responseDoc.ToJson<MongoDB.Bson.BsonDocument>();
精彩评论