[CDRIVER-2764] aggregate inherits writeConcern only if the "pipeline" parameter contains a "pipeline" field Created: 25/Jul/18  Updated: 28/Oct/23  Resolved: 02/Aug/18

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: None
Fix Version/s: 1.13.0

Type: Bug Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-2606 mongoc_collection_watch pipeline argu... Closed
Epic Link: Test option inheritance

 Description   

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.



 Comments   
Comment by Githook User [ 02/Aug/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-2764 fix writeConcern logic for aggregate
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/ab9410e19b0dd211d39aaa9333470cd651e592b5

Generated at Wed Feb 07 21:16:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.