Document how to use mongoc_collection_aggregate with an "array"

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Do
    • Priority: Trivial - P5
    • None
    • Affects Version/s: None
    • Component/s: Docs, libmongoc
    • Not Needed
    • 🔵 Done
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      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
            Reporter:
            Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: