Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3249

Document how to use mongoc_collection_aggregate with an "array"

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: None
    • Component/s: docs, libmongoc
    • Labels:

      mongoc_collection_aggregate documents:

      pipeline: A bson_t, either a BSON array or a BSON document containing an array field named “pipeline”.
      

      Constructing a BSON "array" requires constructing a BSON document with keys "0", "1", "2", ...

      I think it's worth adding to the examples on that page an example of using this form pipeline, e.g. with:

      pipeline = BCON_NEW ("[", "{", "$match", "{" "foo", BCON_UTF8("a"), "}", "}", "]");
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: