Skip to content

Commit c04fb9f

Browse files
author
rstam
committed
Edited release notes to reflect that we removed the GetDatabase method from MongoClient.
1 parent 73d955b commit c04fb9f

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

Release Notes/Change Log v1.7-Driver.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ WriteConcernResult.cs
1111

1212
MongoClient.cs
1313
new root class (see Release Notes)
14-
use instead of MongoServer (or in addition to)
14+
use instead of MongoServer
1515

1616
MongoClientSettings.cs
1717
new class
18-
used instead of MongoServerSettings
18+
use instead of MongoServerSettings
1919

2020
MongoCollection.cs
2121
all methods that used to return a SafeModeResult now return a WriteConcernResult

Release Notes/Release Notes v1.7.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff 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

7273
If you use the old way to start using the driver the default WriteConcern will
7374
be Unacknowledged, but if you use the new way (using MongoClient) the default
7475
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;

0 commit comments

Comments
 (0)