开发者

problem with conversion of JSOn string to Mongo document

I am trying to convert a JSOn string into a Mongo document and there is not much help availabel online.

the only helpful thing that I found was:

1: 2:

MongoDB.Bson.BsonDocument doc4=MongoDB.Bson.Serialization .BsonSerializer.Deserialize(genericjson);

Toggle HighlightingOpen in New WindowSelect All

as described in the post @

Convert string into MongoDB BsonDocument

It creates the document in the databse but it's not the simulation of what it is here in C#. When I click on the nodes they don't show me the data inside. this is what Mongo does when the conversion has corrupted the file.

is 开发者_如何学Cthere any other way to solve it?


Try the BsonDocument.Parse() method, e.g.

var bsonDoc = BsonDocument.Parse(jsonString);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜