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

aggregate inherits writeConcern only if the "pipeline" parameter contains a "pipeline" field

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.13.0
    • Affects Version/s: None
    • Component/s: libmongoc
    • None

      mongo_collection_aggregate used to accept only a document that includes a "pipeline" array. A pipeline that includes an $out stage looks like:

      {pipeline: [{...}, {$out: ...}]}
      

      If the function finds "$out" but there's no explicit writeConcern then it inherits the collection's writeConcern, per spec.

      In CDRIVER-2606 we also accept a BSON array passed directly, not as an element of the input document. That work was incomplete: if mongoc_collection_aggregate is passed a BSON array directly then it doesn't search the array for "$out" and doesn't inherit writeConcern from its collection object.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: