|
| 1 | +C# Driver Version 1.7 Release Notes |
| 2 | +=================================== |
| 3 | + |
| 4 | +This is a major release. |
| 5 | + |
| 6 | +This release has two major goals: to standardize on the name WriteConcern and |
| 7 | +to make Acknowledged the new default WriteConcern. |
| 8 | + |
| 9 | +The following classes are being replaced: |
| 10 | + |
| 11 | +- SafeMode is replaced by WriteConcern |
| 12 | +- SafeModeResult is replaced by WriteConcernResult |
| 13 | +- MongoSafeModeException is replaced by WriteConcernException |
| 14 | + |
| 15 | +To make Acknowledged the new default WriteConcern without breaking any existing |
| 16 | +code that might rely on the old default we are introducing a new root class |
| 17 | +called MongoClient. |
| 18 | + |
| 19 | +An online version of these release notes is available at: |
| 20 | + |
| 21 | +https://github.com/mongodb/mongo-csharp-driver/blob/master/Release%20Notes/Release%20Notes%20v1.7.md |
| 22 | + |
| 23 | +File by file change logs are available at: |
| 24 | + |
| 25 | +https://github.com/mongodb/mongo-csharp-driver/blob/master/Release%20Notes/Change%20Log%20v1.7-Bson.txt |
| 26 | +https://github.com/mongodb/mongo-csharp-driver/blob/master/Release%20Notes/Change%20Log%20v1.7-Driver.txt |
| 27 | + |
| 28 | +The full list of JIRA issues resolved in this release is available at: |
| 29 | + |
| 30 | +https://jira.mongodb.org/secure/IssueNavigator.jspa?mode=hide&requestId=12915 |
| 31 | + |
| 32 | +Documentation on the C# driver can be found at: |
| 33 | + |
| 34 | +http://www.mongodb.org/display/DOCS/CSharp+Language+Center |
| 35 | +http://api.mongodb.org/csharp/current/ |
| 36 | + |
| 37 | +Standardizing on WriteConcern instead of SafeMode |
| 38 | +------------------------------------------------- |
| 39 | + |
| 40 | +Some MongoDB drivers (the C# driver included) have used SafeMode as the name |
| 41 | +for the class which determines whether writes to the database are checked for |
| 42 | +errors. We are now standardizing across all drivers to use the name WriteConcern |
| 43 | +instead of SafeMode. The C# driver will continue to support the SafeMode class |
| 44 | +for a few releases but eventually it will be removed. |
| 45 | + |
| 46 | +You should start using the new WriteConcern class, but we have also provided |
| 47 | +an implicit conversion from SafeMode to WriteConcern so any code that passes |
| 48 | +a SafeMode argument to a method taking a WriteConcern parameter will still |
| 49 | +compile and work. |
| 50 | + |
| 51 | +New MongoClient class and default WriteConcern |
| 52 | +---------------------------------------------- |
| 53 | + |
| 54 | +The new default WriteConcern is Acknowledged, but we have introduced the new |
| 55 | +default in a way that doesn't alter the behavior of existing programs. We |
| 56 | +are introducing a new root class called MongoClient that defaults the |
| 57 | +WriteConcern to Acknowledged. The existing MongoServer Create methods are |
| 58 | +deprecated but when used continue to default to a WriteConcern of Unacknowledged. |
| 59 | + |
| 60 | +In prior releases you would start using the C# driver with code like this: |
| 61 | + |
| 62 | + var connectionString = "mongodb://localhost"; |
| 63 | + var server = MongoServer.Create(connectionString); // deprecated |
| 64 | + var database = server.GetDatabase("test"); // WriteConcern defaulted to Unacknowledged |
| 65 | + |
| 66 | +The new way to start using the C# driver is: |
| 67 | + |
| 68 | + var connectionString = "mongodb://localhost"; |
| 69 | + var client = new MongoClient(connectionString); |
| 70 | + var server = client.GetServer(); |
| 71 | + var database = server.GetDatabase("test"); // WriteConcern defaulted to Acknowledged |
| 72 | + |
| 73 | +If you use the old way to start using the driver the default WriteConcern will |
| 74 | +be Unacknowledged, but if you use the new way (using MongoClient) the default |
| 75 | +WriteConcern will be Acknowledged. |
0 commit comments