[CSHARP-3145] Fix incorrect example in pipeline documentation Created: 26/Jun/20  Updated: 29/Jun/20  Resolved: 29/Jun/20

Status: Closed
Project: C# Driver
Component/s: Documentation
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: Vincent Kam (Inactive) Assignee: Vincent Kam (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

In our refdocs for pipeline definitions: (https://mongodb.github.io/mongo-csharp-driver/2.11/reference/driver/definitions/#pipelines)

We have the following pipeline definition in the docs

PipelineDefinition pipeline = new BsonDocument[] 
{
    new BsonDocument { { "$match", new BsonDocument("x", 1) } },
    new BsonDocument { { "$sort", new BsonDocument("y", 1) } }
};

 
I believe it should be:

PipelineDefinition<BsonDocument, BsonDocument> pipeline = new BsonDocument[] 
{
    new BsonDocument { { "$match", new BsonDocument("x", 1) } },
    new BsonDocument { { "$sort", new BsonDocument("y", 1) } }
};

Additionally, as rstam pointed out, this line is also incorrect:

> It is implicitly convertible from a List<BsonDocument>, a BsonDocument, a List<IPipelineStageDefinition> , and a IPipelineStageDefinition[].

It should state:
> It is implicitly convertible from a List<BsonDocument>, a BsonDocument[], a List<IPipelineStageDefinition> , and a IPipelineStageDefinition[].



 Comments   
Comment by Githook User [ 29/Jun/20 ]

Author:

{'name': 'vincentkam', 'email': 'vincent.kam@10gen.com', 'username': 'vincentkam'}

Message: CSHARP-3145: Fix incorrect example in pipeline documentation
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/a0aadd286160e11a6b6a728d256a05b991c64140

Generated at Wed Feb 07 21:44:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.