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 -

php - Boolean search on database with 5 million rows, very slow -

css - Text drops down with smaller window -