You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Docs/reference/content/index.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,14 +10,14 @@ type = "index"
10
10
The [Getting Started]({{< relref "getting_started\index.md" >}}) guide contains information about system requirements, installation, and a simple tutorial to get up and running quickly.
11
11
12
12
13
-
## What's new in 2.0
13
+
## What's new in 2.1
14
14
15
-
The [What's New]({{< relref "what_is_new.md" >}}) contains the major new features of the driver, the most important of which is full async support.
15
+
The [What's New]({{< relref "what_is_new.md" >}}) contains the major new features of the driver.
16
16
17
17
18
18
## Upgrading
19
19
20
-
If you are coming from the 1.x series of the driver, consult the [upgrading]({{< relref "upgrading.md" >}}) documentation on major changes.
20
+
If you are coming from the 2.0.x series of the driver, consult the [upgrading]({{< relref "upgrading.md" >}}) documentation on changes.
Copy file name to clipboardExpand all lines: Docs/reference/content/upgrading.md
+1-159Lines changed: 1 addition & 159 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,162 +11,4 @@ title = "Upgrading"
11
11
12
12
## Breaking Changes
13
13
14
-
As 2.0 is a major revision, there are some breaking changes when coming from the 1.x assemblies. We've tried our best to mitigate those breaking changes, but some were inevitable. These changes may not affect everyone, but take a moment to review the list of known changes below:
15
-
16
-
### System Requirements
17
-
18
-
- .NET 3.5 and .NET 4.0 are no longer supported. If you still must use these platforms, the 1.x series of the driver will continue to be developed.
19
-
-[CSHARP-952](https://jira.mongodb.org/browse/CSHARP-952): We've removed support for partially trusted callers.
20
-
21
-
22
-
### Packaging
23
-
24
-
- The nuget package [mongocsharpdriver](http://nuget.org/packages/mongocsharpdriver) now includes the legacy driver. It depends on 3 new nuget packages, [MongoDB.Bson](http://nuget.org/packages/MongoDB.Bson), [MongoDB.Driver.Core](http://nuget.org/packages/MongoDB.Driver.Core), and [MongoDB.Driver](http://nuget.org/packages/MongoDB.Driver). [MongoDB.Driver](http://nuget.org/packages/MongoDB.Driver) is the replacement for [mongocsharpdriver](http://nuget.org/packages/mongocsharpdriver).
25
-
-[CSHARP-616](https://jira.mongodb.org/browse/CSHARP-616): We are no longer strong naming our assemblies. Our previous strong naming was signed with a key in our public repository. This did nothing other than satisfy certain tools. If you need MongoDB assemblies to be strongly named, it is relatively straight-forward to build the assemblies yourself.
26
-
27
-
28
-
### BSON
29
-
30
-
-[CSHARP-933](https://jira.mongodb.org/browse/CSHARP-933): Improved the BSON Serializer infrastructure. Anyone who has written a custom serializer will be affected by this. The changes are minor, but were necessary to support dynamic serializers as well as offering great speed improvements and improved memory management.
31
-
- Certain methods, such as `BsonMemberMap.SetRepresentation` have been removed. The proper way to set a representation, for instance, would be to use `SetSerializer` and configure the serializer with the appropriate representation.
32
-
-[CSHARP-939](https://jira.mongodb.org/browse/CSHARP-939): Dynamic DictionaryRepresentation has been removed. Its intent was to store, in some manner, anything in a .NET dictionary. In practice, this leads to the same values getting stored in different ways depending on factors such as a "." inside the key name. We made the decision to eliminate this variability. This means that documents that used to serialize correctly may start throwing a BsonSerializationException with a message indicating the key must be a valid string. [CSHARP-1165](https://jira.mongodb.org/browse/CSHARP-1165) has a solution to this problem. It should be noted that we will continue to read these disparate representations without error.
33
-
-`null` is no longer ignored in BsonValue-derived constructors. Anyone relying on null getting ignored will now receive an `ArgumentNullException`.
34
-
35
-
36
-
### Driver
37
-
-[CSHARP-979](https://jira.mongodb.org/browse/CSHARP-979): `MongoConnectionStringBuilder` has been removed. Use the documented mongodb connection string format and/or `MongoUrlBuilder`.
38
-
-`MongoServer` is a deprecated class. Anyone using `MongoClient.GetServer()` will encounter a deprecation warning and, depending on how your build is setup, may receive an error. It is still safe to use this API until your code is ported to the new API. *Note that this API requires the use of the [mongocsharpdriver](http://nuget.org/packages/mongocsharpdriver) to include the legacy API.
39
-
-[CSHARP-1043](https://jira.mongodb.org/browse/CSHARP-1043) and [CSHARP-1044](https://jira.mongodb.org/browse/CSHARP-1044): `ReadPreference` and `WriteConcern` were rewritten. These classes are now immutable. Any current application code that sets values on these classes will no longer function. Instead, you should use the With method to alter a `ReadPreference` or `WriteConcern`.
You cannot iterate synchronously using a foreach loop without first getting a list. However, there are alternative methods provided to loop over all the documents in an asynchronous manner.
Copy file name to clipboardExpand all lines: Docs/reference/content/what_is_new.md
+9-75Lines changed: 9 additions & 75 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,89 +8,23 @@ title = "What's New"
8
8
pre = "<i class='fa fa-star'></i>"
9
9
+++
10
10
11
-
## What's New in the MongoDB .NET 2.0 Driver
11
+
## What's New in the MongoDB .NET 2.1 Driver
12
12
13
-
The 2.0 driver ships with a host of new features. The most notable are discussed below.
13
+
The 2.1 driver ships with a number of new features. The most notable are discussed below.
14
14
15
15
16
-
## Async
16
+
## GridFS
17
17
18
-
As has been requested for a while now, the driver now offers a full async stack. Since it uses Tasks, it is fully usable
19
-
with async and await.
18
+
[CSHARP-1191](https://jira.mongodb.org/browse/CSHARP-1191) - GridFS support has been implemented.
20
19
21
-
While we offer a mostly backwards-compatible sync API, it is calling into the async stack underneath. Until you are ready
22
-
to move to async, you should measure against the 1.x versions to ensure performance regressions don't enter your codebase.
23
20
24
-
All new applications should utilize the New API.
21
+
## LINQ
25
22
23
+
[CSHARP-935](https://jira.mongodb.org/browse/CSHARP-935) LINQ support has been rewritten and now targets the aggregation framework. It is a more natural translation and enables many features of LINQ that were previously not able to be translated.
26
24
27
-
## New API
25
+
Simply use the new [`AsQueryable`]({{< apiref "M_MongoDB_Driver_IMongoCollectionExtensions_AsQueryable__1" >}}) method to work with LINQ.
28
26
29
-
Because of our async nature, we have rebuilt our entire API. The new API is accessible via MongoClient.GetDatabase.
30
27
31
-
- Interfaces are used ([`IMongoClient`]({{< apiref "T_MongoDB_Driver_IMongoClient" >}}), [`IMongoDatabase`]({{< apiref "T_MongoDB_Driver_IMongoDatabase" >}}), [`IMongoCollection<TDocument>`]({{< apiref "T_MongoDB_Driver_IMongoCollection_1" >}})) to support easier testing.
32
-
- A fluent Find API is available with full support for expression trees including projections.
28
+
## Eventing
33
29
34
-
``` csharp
35
-
var names = await db.GetCollection<Person>("people")
36
-
.Find(x => x.FirstName == "Jack")
37
-
.SortBy(x => x.Age)
38
-
.Project(x => x.FirstName + " " + x.LastName)
39
-
.ToListAsync();
40
-
```
41
-
42
-
- A fluent Aggregation API is available with mostly-full support for expression trees.
43
-
44
-
``` csharp
45
-
var totalAgeByLastName = await db.GetCollection<Person>("people")
46
-
.Aggregate()
47
-
.Match(x => x.FirstName == "Jack")
48
-
.GroupBy(x => x.LastName, g => new { _id = g.Key, TotalAge = g.Sum(x => x.Age)})
49
-
.ToListAsync();
50
-
```
51
-
52
-
- Support for dynamic.
53
-
54
-
``` csharp
55
-
var person = new ExpandoObject();
56
-
person.FirstName = "Jane";
57
-
person.Age = 12;
58
-
person.PetNames = new List<dynamic> { "Sherlock", "Watson" }
0 commit comments