Skip to content

Commit 188c3ed

Browse files
committed
upgraded docs for pending release.
1 parent ef59532 commit 188c3ed

File tree

12 files changed

+116
-252
lines changed

12 files changed

+116
-252
lines changed

Docs/landing/data/releases.toml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
current = "2.0.0"
1+
current = "2.0.1"
22
[[versions]]
3-
version = "2.0.0"
3+
version = "2.1.0-rc0"
44
status = "rc"
5+
docs = "http://mongodb.github.io/mongo-csharp-driver/2.1/"
6+
api = "http://api.mongodb.org/csharp/2.1"
7+
8+
[[versions]]
9+
version = "2.0.1"
10+
status = "current"
511
docs = "http://mongodb.github.io/mongo-csharp-driver/2.0/"
612
api = "http://api.mongodb.org/csharp/2.0"
713

814
[[versions]]
9-
version = "1.10.0"
15+
version = "1.10.1"
1016
status = "current"
1117
docs = "http://mongodb.github.io/mongo-csharp-driver/1.10"
1218
api = "http://api.mongodb.org/csharp/1.10"
@@ -16,25 +22,32 @@ current = "2.0.0"
1622
package = "MongoDB.Driver"
1723
description = "The driver."
1824
dependencies = ".NET Core Driver,.NET BSON Library"
19-
versions = "2.0.0"
25+
versions = "2.1.0-rc0,2.0.1"
26+
27+
[[drivers]]
28+
name = ".NET GridFS"
29+
package = "MongoDB.Driver.GridFS"
30+
description = "The GridFS library."
31+
dependencies = ".NET Driver,.NET Core Driver,.NET BSON Library"
32+
versions = "2.1.0-rc0"
2033

2134
[[drivers]]
2235
name = ".NET Core Driver"
2336
package = "MongoDB.Driver.Core"
2437
description = "The core driver."
2538
dependencies = ".NET BSON Library"
26-
versions = "2.0.0"
39+
versions = "2.1.0-rc0,2.0.1"
2740

2841
[[drivers]]
2942
name = ".NET BSON Library"
3043
package = "MongoDB.Bson"
3144
description = "The BSON library."
3245
dependencies = ""
33-
versions = "2.0.0"
46+
versions = "2.1.0-rc0,2.0.1"
3447

3548
[[drivers]]
3649
name = ".NET Legacy Driver"
3750
package = "mongocsharpdriver"
3851
description = "The legacy driver."
3952
dependencies = ".NET Driver,.NET Core Driver,.NET BSON Library"
40-
versions = "2.0.0,1.10.0"
53+
versions = "2.1.0-rc0,2.0.1,1.10.1"

Docs/landing/layouts/partials/features.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ <h2>Features</h2>
33
<dl>
44
<dt>Driver</dt>
55
<dd>A completely async driver to talk with MongoDB.</dd>
6-
<dt>Core driver</dt>
6+
<dt>GridFS</dt>
7+
<dd>A distributed file system built on MongoDB.</dd>
8+
<dt>Core Driver</dt>
79
<dd>The MongoDB Driver is built on top of a new Core library which anyone can use to build alternative or experimental high-level APIs.</dd>
810
<dt>BSON Library</dt>
911
<dd>A standalone BSON library, with a serialization infrastructure that you can use to build high-performance serializers.</dd>

Docs/landing/static/versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"version": "2.0"}, {"version": "1.10"}]
1+
[{"version": "2.1"},{"version": "2.0"}, {"version": "1.10"}]

Docs/reference/config.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
baseurl = "/mongo-csharp-driver/2.0"
1+
baseurl = "/mongo-csharp-driver/2.1"
22
languageCode = "en-us"
33
title = "MongoDB .NET Driver"
44
theme = "mongodb"
@@ -12,7 +12,7 @@ canonifyurls = false
1212
pre = "<i class='fa fa-file-text-o'></i>"
1313
weight = 800
1414
identifier = "apiDocs"
15-
url = "http://api.mongodb.org/csharp/2.0"
15+
url = "http://api.mongodb.org/csharp/2.1"
1616

1717
[[menu.main]]
1818
name = "Source Code"

Docs/reference/content/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ type = "index"
1010
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.
1111

1212

13-
## What's new in 2.0
13+
## What's new in 2.1
1414

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.
1616

1717

1818
## Upgrading
1919

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.
2121

2222

2323
## Reference

Docs/reference/content/upgrading.md

Lines changed: 1 addition & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -11,162 +11,4 @@ title = "Upgrading"
1111

1212
## Breaking Changes
1313

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`.
40-
41-
``` csharp
42-
var writeConcern = myCurrentWriteConcern.With(journal: true);
43-
```
44-
45-
## Migrating
46-
47-
Below are some common actions in the old API and their counterpart in the new API.
48-
49-
### Builders
50-
51-
_[More information.]({{< relref "reference\driver\definitions.md" >}})_
52-
53-
The old builders (`Query`, `Update`, etc...) have all been replaced by `Builders<T>.Filter`, `Builders<T>.Update`, etc...
54-
55-
```csharp
56-
// old API
57-
var query = Query.And(
58-
Query<Person>.EQ(x => x.FirstName, "Jack"),
59-
Query<Person>.LT(x => x.Age, 21));
60-
61-
// new API
62-
var builder = Builders<Person>.Filter;
63-
var filter = builder.Eq(x => x.FirstName, "Jack") & builder.Lt(x => x.Age, 21);
64-
```
65-
66-
```csharp
67-
// old API
68-
var update = Update.Combine(
69-
Update<Person>.Set(x => x.LastName, "McJack"),
70-
Update<Person>.Inc(x => x.Age, 1));
71-
72-
// new API
73-
var update = Builders<Person>.Update
74-
.Set(x => x.LastName, "McJack")
75-
.Inc(x => x.Age, 1);
76-
```
77-
78-
### Finding All Documents
79-
80-
_[More information.]({{< relref "reference\driver\crud\reading.md#finding-documents" >}})_
81-
82-
To match all documents, you must specify an empty filter.
83-
84-
```csharp
85-
// old API
86-
var list = collection.FindAll().ToList();
87-
88-
// new API
89-
var list = await collection.Find(new BsonDocument()).ToListAsync();
90-
```
91-
92-
### Finding One Document
93-
94-
_[More information.]({{< relref "reference\driver\crud\reading.md#single-results" >}})_
95-
96-
To match all documents, you must specify an empty filter.
97-
98-
```csharp
99-
// old API
100-
var document = collection.FindOne();
101-
102-
// new API
103-
var document = await collection.Find(new BsonDocument()).FirstOrDefaultAsync();
104-
```
105-
106-
### Iteration
107-
108-
_[More information.]({{< relref "reference\driver\crud\reading.md#iteration" >}})_
109-
110-
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.
111-
112-
```csharp
113-
// old API
114-
foreach (var document in collection.Find(new QueryDocument("Name", "Jack")))
115-
{
116-
// do something
117-
}
118-
119-
// new API
120-
await collection.Find(new BsonDocument("Name", "Jack"))
121-
.ForEachAsync(document =>
122-
{
123-
// do something
124-
});
125-
126-
await collection.Find(new BsonDocument("Name", "Jack"))
127-
.ForEachAsync(async document =>
128-
{
129-
// do something with await
130-
});
131-
```
132-
133-
### Counting All Documents
134-
135-
_[More information.]({{< relref "reference\driver\crud\reading.md#counting-documents" >}})_
136-
137-
To match all documents, you must specify an empty filter.
138-
139-
```csharp
140-
// old API
141-
var count = collection.Count();
142-
143-
// new API
144-
var count = await collection.CountAsync(new BsonDocument());
145-
```
146-
147-
### Mapping - SetRepresentation
148-
149-
_[More information.]({{< relref "reference\bson\mapping\index.md#representation" >}})_
150-
151-
You can still use attributes as you have done before. To set the representation via code:
152-
153-
```csharp
154-
class Test
155-
{
156-
public char RepresentAsInt32 { get; set; }
157-
}
158-
159-
// old API
160-
BsonClassMap.RegisterClassMap<Person>(cm =>
161-
{
162-
// snip...
163-
cm.MapMember(x => x.RepresentAsInt32).SetRepresentation(BsonType.Int32);
164-
});
165-
166-
// new API
167-
BsonClassMap.RegisterClassMap<Person>(cm =>
168-
{
169-
// snip...
170-
cm.MapMember(x => x.RepresentAsInt32).SetSerializer(new CharSerializer(BsonType.Int32));
171-
});
172-
```
14+
As 2.1 is a minor revision that comes with new features. There should not be any backwards breaking changes.

Docs/reference/content/what_is_new.md

Lines changed: 9 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -8,89 +8,23 @@ title = "What's New"
88
pre = "<i class='fa fa-star'></i>"
99
+++
1010

11-
## What's New in the MongoDB .NET 2.0 Driver
11+
## What's New in the MongoDB .NET 2.1 Driver
1212

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.
1414

1515

16-
## Async
16+
## GridFS
1717

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.
2019

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.
2320

24-
All new applications should utilize the New API.
21+
## LINQ
2522

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.
2624

27-
## New API
25+
Simply use the new [`AsQueryable`]({{< apiref "M_MongoDB_Driver_IMongoCollectionExtensions_AsQueryable__1" >}}) method to work with LINQ.
2826

29-
Because of our async nature, we have rebuilt our entire API. The new API is accessible via MongoClient.GetDatabase.
3027

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
3329

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" }
59-
await db.GetCollection<dynamic>("people").InsertOneAsync(person);
60-
```
61-
62-
63-
## Experimental Features
64-
65-
We've also include some experimental features which are subject to change. These are both based on the Listener API.
66-
67-
68-
### Logging
69-
70-
It is possible to see what is going on deep down in the driver by listening to core events. We've included a simple text logger as an example:
71-
72-
``` csharp
73-
var settings = new MongoClientSettings
74-
{
75-
ClusterConfigurator = cb =>
76-
{
77-
var textWriter = TextWriter.Synchronized(new StreamWriter("mylogfile.txt"));
78-
cb.AddListener(new LogListener(textWriter));
79-
}
80-
};
81-
```
82-
83-
84-
### Performance Counters
85-
86-
Windows Performance Counters can be enabled to track statistics like average message size, number of connections in the pool, etc...
87-
88-
``` csharp
89-
var settings = new MongoClientSettings
90-
{
91-
ClusterConfigurator = cb =>
92-
{
93-
cb.UsePeformanceCounters("MyApplicationName");
94-
}
95-
};
96-
```
30+
Blurb on eventing once APM is pushed.

Docs/reference/data/mongodb.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
githubRepo = "mongo-csharp-driver"
22
githubBranch = "master"
3-
currentVersion = "2.0"
3+
currentVersion = "2.1"
44
highlightTheme = "idea.css"
5-
apiUrl = "http://api.mongodb.org/csharp/2.0/html"
5+
apiUrl = "http://api.mongodb.org/csharp/2.1/html"

0 commit comments

Comments
 (0)