Skip to content

Commit ca403e4

Browse files
committed
minor changes for 2.1.0-rc1 release.
1 parent 53282cb commit ca403e4

File tree

6 files changed

+61
-11
lines changed

6 files changed

+61
-11
lines changed

Docs/landing/data/releases.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
current = "2.0.1"
22
[[versions]]
3-
version = "2.1.0-rc0"
3+
version = "2.1.0-rc1"
44
status = "rc"
55
docs = "http://mongodb.github.io/mongo-csharp-driver/2.1/"
66
api = "http://api.mongodb.org/csharp/2.1"
@@ -22,32 +22,32 @@ current = "2.0.1"
2222
package = "MongoDB.Driver"
2323
description = "The driver."
2424
dependencies = ".NET Core Driver,.NET BSON Library"
25-
versions = "2.1.0-rc0,2.0.1"
25+
versions = "2.1.0-rc1,2.0.1"
2626

2727
[[drivers]]
2828
name = ".NET GridFS"
2929
package = "MongoDB.Driver.GridFS"
3030
description = "The GridFS library."
3131
dependencies = ".NET Driver,.NET Core Driver,.NET BSON Library"
32-
versions = "2.1.0-rc0"
32+
versions = "2.1.0-rc1"
3333

3434
[[drivers]]
3535
name = ".NET Core Driver"
3636
package = "MongoDB.Driver.Core"
3737
description = "The core driver."
3838
dependencies = ".NET BSON Library"
39-
versions = "2.1.0-rc0,2.0.1"
39+
versions = "2.1.0-rc1,2.0.1"
4040

4141
[[drivers]]
4242
name = ".NET BSON Library"
4343
package = "MongoDB.Bson"
4444
description = "The BSON library."
4545
dependencies = ""
46-
versions = "2.1.0-rc0,2.0.1"
46+
versions = "2.1.0-rc1,2.0.1"
4747

4848
[[drivers]]
4949
name = ".NET Legacy Driver"
5050
package = "mongocsharpdriver"
5151
description = "The legacy driver."
5252
dependencies = ".NET Driver,.NET Core Driver,.NET BSON Library"
53-
versions = "2.1.0-rc0,2.0.1,1.10.1"
53+
versions = "2.1.0-rc1,2.0.1,1.10.1"

Release Notes/Release Notes v2.1.0.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# .NET Driver Version 2.1.0-rc0 Release Notes
1+
# .NET Driver Version 2.1.0-rc1 Release Notes
22

33
(Preliminary)
44

@@ -21,6 +21,7 @@ http://mongodb.github.io/mongo-csharp-driver/
2121

2222
Notable new features are listed below. For a full list, see the full list of JIRA issues linked above.
2323

24+
2425
### GridFS
2526

2627
[CSHARP-1191](https://jira.mongodb.org/browse/CSHARP-1191) - GridFS support has been implemented.
@@ -33,6 +34,11 @@ Notable new features are listed below. For a full list, see the full list of JIR
3334
Simply use the new [`AsQueryable`]({{< apiref "M_MongoDB_Driver_IMongoCollectionExtensions_AsQueryable__1" >}}) method to work with LINQ.
3435

3536

37+
### Eventing
38+
39+
[CSHARP-1374](https://jira.mongodb.org/browse/CSHARP-1374) - An eventing API has been added allowing a user to subscribe to one or more events from the core driver for insight into server discovery, server selection, connection pooling, and commands.
40+
41+
3642
## Upgrading
3743

3844
There are no known backwards breaking changes in this release.

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 2.0.0.{build}
1+
version: 2.1.0.{build}
22

33
branches:
44
only:
@@ -12,7 +12,7 @@ test: off
1212

1313
build_script:
1414
- build.cmd Build
15-
- ps: Start-FileDownload 'https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.6.3-signed.msi' -FileName 'C:\build\mongodb.msi'
15+
- ps: Start-FileDownload 'https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-3.0.6-signed.msi' -FileName 'C:\build\mongodb.msi'
1616
- msiexec /i C:\build\mongodb.msi /qn /log c:\build\mongodb-install.log INSTALLLOCATION=C:\MongoDB
1717
- ps: mkdir c:\build\data
1818
- ps: Start-Process -NoNewWindow C:\MongoDB\bin\mongod.exe -ArgumentList "-dbpath c:\build\data -smallfiles -oplogSize 100 -setParameter enableTestCommands=1"

src/MongoDB.Driver/AggregateFluent.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
using System.Threading.Tasks;
2222
using MongoDB.Bson;
2323
using MongoDB.Bson.Serialization;
24+
using MongoDB.Bson.Serialization.Serializers;
2425
using MongoDB.Driver.Core.Misc;
2526

2627
namespace MongoDB.Driver
@@ -85,6 +86,29 @@ public override IAggregateFluent<TResult> Limit(int limit)
8586
return AppendStage<TResult>(new BsonDocument("$limit", limit));
8687
}
8788

89+
public override IAggregateFluent<TNewResult> Lookup<TNewResult>(string from, FieldDefinition<TResult> localField, FieldDefinition<BsonDocument> foreignField, FieldDefinition<TNewResult> @as, IBsonSerializer<TNewResult> newResultSerializer = null)
90+
{
91+
const string operatorName = "$lookup";
92+
var stage = new DelegatedPipelineStageDefinition<TResult, TNewResult>(
93+
operatorName,
94+
(s, sr) =>
95+
{
96+
newResultSerializer = newResultSerializer ?? (s as IBsonSerializer<TNewResult>) ?? sr.GetSerializer<TNewResult>();
97+
return new RenderedPipelineStageDefinition<TNewResult>(
98+
operatorName,
99+
new BsonDocument(operatorName, new BsonDocument
100+
{
101+
{ "from", from },
102+
{ "localField", localField.Render(s, sr).FieldName },
103+
{ "foreignField", foreignField.Render(BsonDocumentSerializer.Instance, sr).FieldName },
104+
{ "as", @as.Render(newResultSerializer, sr).FieldName },
105+
}),
106+
newResultSerializer);
107+
});
108+
109+
return AppendStage<TNewResult>(stage);
110+
}
111+
88112
public override IAggregateFluent<TResult> Match(FilterDefinition<TResult> filter)
89113
{
90114
const string operatorName = "$match";

src/MongoDB.Driver/AggregateFluentBase.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* limitations under the License.
1414
*/
1515

16+
using System;
1617
using System.Collections.Generic;
1718
using System.Threading;
1819
using System.Threading.Tasks;
@@ -45,6 +46,12 @@ public abstract class AggregateFluentBase<TResult> : IOrderedAggregateFluent<TRe
4546
/// <inheritdoc />
4647
public abstract IAggregateFluent<TResult> Limit(int limit);
4748

49+
/// <inheritdoc />
50+
public virtual IAggregateFluent<TNewResult> Lookup<TNewResult>(string from, FieldDefinition<TResult> localField, FieldDefinition<BsonDocument> foreignField, FieldDefinition<TNewResult> @as, IBsonSerializer<TNewResult> newResultSerializer = null)
51+
{
52+
throw new NotImplementedException();
53+
}
54+
4855
/// <inheritdoc />
4956
public abstract IAggregateFluent<TResult> Match(FilterDefinition<TResult> filter);
5057

@@ -68,5 +75,6 @@ public abstract class AggregateFluentBase<TResult> : IOrderedAggregateFluent<TRe
6875

6976
/// <inheritdoc />
7077
public abstract Task<IAsyncCursor<TResult>> ToCursorAsync(CancellationToken cancellationToken);
78+
7179
}
7280
}

src/MongoDB.Driver/IAggregateFluent.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ public interface IAggregateFluent<TResult> : IAsyncCursorSource<TResult>
5050
IAggregateFluent<TNewResult> AppendStage<TNewResult>(PipelineStageDefinition<TResult, TNewResult> stage);
5151

5252
/// <summary>
53-
/// Adds a project stage to the pipeline to project the result to a new type.
53+
/// Appends a project stage to the pipeline.
5454
/// </summary>
5555
/// <typeparam name="TNewResult">The type of the new result.</typeparam>
5656
/// <param name="newResultSerializer">The new result serializer.</param>
5757
/// <returns>The fluent aggregate interface.</returns>
5858
IAggregateFluent<TNewResult> As<TNewResult>(IBsonSerializer<TNewResult> newResultSerializer = null);
5959

6060
/// <summary>
61-
/// Appends a group stage to the stages.
61+
/// Appends a group stage to the pipeline.
6262
/// </summary>
6363
/// <typeparam name="TNewResult">The type of the result of the stage.</typeparam>
6464
/// <param name="group">The group projection.</param>
@@ -72,6 +72,18 @@ public interface IAggregateFluent<TResult> : IAsyncCursorSource<TResult>
7272
/// <returns>The fluent aggregate interface.</returns>
7373
IAggregateFluent<TResult> Limit(int limit);
7474

75+
/// <summary>
76+
/// Appens a lookup stage to the pipeline.
77+
/// </summary>
78+
/// <typeparam name="TNewResult">The type of the new result.</typeparam>
79+
/// <param name="from">From.</param>
80+
/// <param name="localField">The local field.</param>
81+
/// <param name="foreignField">The foreign field.</param>
82+
/// <param name="as">As.</param>
83+
/// <param name="newResultSerializer">The new result serializer.</param>
84+
/// <returns></returns>
85+
IAggregateFluent<TNewResult> Lookup<TNewResult>(string from, FieldDefinition<TResult> localField, FieldDefinition<BsonDocument> foreignField, FieldDefinition<TNewResult> @as, IBsonSerializer<TNewResult> newResultSerializer = null);
86+
7587
/// <summary>
7688
/// Appends a match stage to the pipeline.
7789
/// </summary>

0 commit comments

Comments
 (0)