How to insert data into a mongodb collection using the c# 2.0 driver?
问题 I'm using the MongoClient in my c# console application to connect to MongoDB https://github.com/mongodb/mongo-csharp-driver/releases/tag/v2.0.0-rc0 My code class Program { static void Main(string[] args) { const string connectionString = "mongodb://localhost:27017"; // Create a MongoClient object by using the connection string var client = new MongoClient(connectionString); //Use the MongoClient to access the server var database = client.GetDatabase("test"); var collection = database