File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,11 @@ WriteConcernResult.cs
1111
1212MongoClient.cs
1313 new root class (see Release Notes)
14- use instead of MongoServer (or in addition to)
14+ use instead of MongoServer
1515
1616MongoClientSettings.cs
1717 new class
18- used instead of MongoServerSettings
18+ use instead of MongoServerSettings
1919
2020MongoCollection.cs
2121 all methods that used to return a SafeModeResult now return a WriteConcernResult
Original file line number Diff line number Diff line change @@ -67,19 +67,9 @@ The new way to start using the C# driver is:
6767
6868 var connectionString = "mongodb://localhost";
6969 var client = new MongoClient(connectionString);
70- var database = client.GetDatabase("test"); // WriteConcern defaulted to Acknowledged
70+ var server = client.GetServer();
71+ var database = server.GetDatabase("test"); // WriteConcern defaulted to Acknowledged
7172
7273If you use the old way to start using the driver the default WriteConcern will
7374be Unacknowledged, but if you use the new way (using MongoClient) the default
7475WriteConcern will be Acknowledged.
75-
76- If for some reason you need access to the MongoServer object you can write this instead:
77-
78- var connectionString = "mongodb://localhost";
79- var client = new MongoClient(connectionString);
80- var server = client.GetServer();
81- var database = server.GetDatabase("test");
82-
83- You can also navigate from the MongoDatabase object to the MongoServer it belongs to:
84-
85- var server = database.Server;
You can’t perform that action at this time.
0 commit comments