<pre> var client = new MongoClient(); IMongoDatabase db = client.GetDatabase("TestDB1"); string text = System.IO.File.ReadAllText(@"D:\DataMorph\Check.json"); //var document = BsonSerializer.Deserialize<BsonDocument>(text); //var collection = db.GetCollection<BsonDocument>(collectionName); BsonDocument document = MongoDB.Bson.Serialization.BsonSerializer.Deserialize<BsonDocument>(text); var collection = db.GetCollection<BsonDocument>("data"); collection.InsertOne(document);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)