简体   繁体   中英

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 there any other way to solve it?

尝试BsonDocument.Parse()方法,例如

var bsonDoc = BsonDocument.Parse(jsonString);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM