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

Fix incorrect example in pipeline documentation

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Minor - P4
    • Resolution: Done
    • None
    • None
    • Documentation
    • 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 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[].

      Attachments

        Activity

          People

            vincent.kam@mongodb.com Vincent Kam (Inactive)
            vincent.kam@mongodb.com Vincent Kam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: