[CDRIVER-2205] Array Update Improvements Created: 10/Jul/17  Updated: 28/Oct/23  Resolved: 12/Oct/17

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

Type: New Feature Priority: Major - P3
Reporter: Rathi Gnanasekaran Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by CXX-1390 Array Update Improvements Closed
is depended on by DRIVERS-387 Array Update Improvements Closed
Related
related to CDRIVER-2664 Raise client error if arrayFilters op... Closed
related to PHPC-975 Array Update Improvements Closed
related to CDRIVER-2412 Support ReplaceOptions in CRUD API Closed
Epic Link: Cdriver MongoDB 3.6 Support

 Comments   
Comment by A. Jesse Jiryu Davis [ 12/Oct/17 ]

Splendid.

Comment by Kevin Albertson [ 12/Oct/17 ]

The new mongoc_collection_update_one_with_opts and mongoc_collection_update_many_with_opts functions support arrayFilters through the opts parameter.

Comment by Githook User [ 11/Oct/17 ]

Author:

{'email': 'kevin.albertson@10gen.com', 'name': 'Kevin Albertson', 'username': 'kevinAlbs'}

Message: CDRIVER-2205 fix wc on update_and_replace tests
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/ed198434edd0dd6a967201820d9af4891cb4e9a9

Comment by Githook User [ 10/Oct/17 ]

Author:

{'email': 'kevin.albertson@10gen.com', 'name': 'Kevin Albertson', 'username': 'kevinAlbs'}

Message: CDRIVER-2205 test update and replace with opts
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/b3c9735757e1c544250afb125f8f76d6a795c0bc

Comment by Githook User [ 05/Oct/17 ]

Author:

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

Message: CDRIVER-2205 add example-update to dist tarball
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/a4fd71fc3e4ea6c7706ac5be49559a4b6d71d975

Comment by Githook User [ 05/Oct/17 ]

Author:

{'email': 'kevin.albertson@10gen.com', 'name': 'Kevin Albertson', 'username': 'kevinAlbs'}

Message: CDRIVER-2205 add update with opts functions
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/2a329015756b28249806e4cb40902a7e10a6d99f

Comment by Githook User [ 03/Oct/17 ]

Author:

{'email': 'kevin.albertson@10gen.com', 'name': 'Kevin Albertson', 'username': 'kevinAlbs'}

Message: CDRIVER-2205 add docs for new update fns
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/870cf01236ed4c4e554563e1dd413bc06fbd30b9

Comment by Kevin Albertson [ 27/Sep/17 ]

It looks like we already support the arrayFilters parameter on find_and_modify and the bulk update operations.

mongoc_collection_find_and_modify_with_opts
has a separate opts struct, but fortunately we have a mongoc_find_and_modify_opts_append function. I wrote an example passing arrayFilter and it does work as expected.

mongoc_bulk_operation_update_one_with_opts
mongoc_bulk_operation_update_many_with_opts
take a bson_t for opts, and concatenate them to the command. I believe these should work out of the box but have not verified yet.

mongoc_collection_update
does not have an options argument. You can call mongoc_collection_write_command_with_opts but our docs discourage using this for basic crud commands. Instead, we can create separate functions mongoc_collection_update_one_with_opts and mongoc_collection_update_many_with_opts which follow the CRUD spec more closely as well.

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