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

Fix incorrect example in pipeline documentation

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Documentation
    • None

      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

      Unable to find source-code formatter for language: csharp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      PipelineDefinition pipeline = new BsonDocument[] 
      {
          new BsonDocument { { "$match", new BsonDocument("x", 1) } },
          new BsonDocument { { "$sort", new BsonDocument("y", 1) } }
      };
      

       
      I believe it should be:

      Unable to find source-code formatter for language: csharp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      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[].

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

              Created:
              Updated:
              Resolved: