I have C# app and I added the nugget mongodb driver.
My mongodb database is called DevServers
My collection is called server
So I'm trying to connect and then just insert a random document since I assume that is allowed with mongo , it doesn't match the other 3 in the collection/db
var connectionString = "mongodb://root:[email protected]:27017";
var client = new MongoClient(connectionString);
var db = client.GetDatabase("DevServers");
var collection = db.GetCollection<BsonDocument>("server");
var document = new BsonDocument
{
{"Brand","Dell"},
{"Price","400"},
{"Ram","8GB"},
{"HardDisk","1TB"},
{"Screen","16inch"}
};
collection.InsertOneAsync(document);
I refresh the Studio 3T app and it does not show any inserts. No error in the try/catch, what am I doing wrong?