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
11
11
12
12
MongoClient.cs
13
13
new root class (see Release Notes)
14
- use instead of MongoServer (or in addition to)
14
+ use instead of MongoServer
15
15
16
16
MongoClientSettings.cs
17
17
new class
18
- used instead of MongoServerSettings
18
+ use instead of MongoServerSettings
19
19
20
20
MongoCollection.cs
21
21
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:
67
67
68
68
var connectionString = "mongodb://localhost";
69
69
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
71
72
72
73
If you use the old way to start using the driver the default WriteConcern will
73
74
be Unacknowledged, but if you use the new way (using MongoClient) the default
74
75
WriteConcern 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