c# - Convert string into MongoDB BsonDocument -


i have long string in json format, , want convert bsondocument insertion mongodb database. how do conversion? i'm using official c# driver.

the answer is:

string json = "{ 'foo' : 'bar' }"; mongodb.bson.bsondocument document     = mongodb.bson.serialization.bsonserializer.deserialize<bsondocument>(json); 

Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -