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
Post a Comment