Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-3145

Fix incorrect example in pipeline documentation

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Documentation
    • Security Level: Public
    • Labels:
      None

      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 Robert Stam 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[].

        Attachments

          Activity

            People

            Assignee:
            vincent.kam Vincent Kam (Inactive)
            Reporter:
            vincent.kam Vincent Kam (Inactive)
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: