[CDRIVER-4371] Remove handling of extra options for bulk write update/replace structs Created: 28/Apr/22  Updated: 02/May/22

Status: Backlog
Project: C Driver
Component/s: Bulk API
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: Jeremy Mikola Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-2665 Consider allow_extra=True for bulk op... Closed
is related to CDRIVER-4199 Add support for the comment field to ... Closed

 Description   

_mongoc_bulk_operation_update_append takes an extra_opts parameter, which when non-empty is concatenated to bson_t opts and passed as the update statement options to _mongoc_write_command_update_append or _mongoc_write_command_init_update. At runtime, the extra_opts parameter provided to _mongoc_bulk_operation_update_append originates from the extra field on the corresponding bulk write option struct.

Looking at generate-opts.py, all of the bulk write structs specify allow_extra=False, so the extra field on update/replace option structs should only ever be an empty document (initialized in the parse method and later destroyed in cleanup).

If this analysis is correct, the extra_opts parameter should simply be removed from the various mongoc-bulk-operation.c functions.

Notably, the delete operations do not reference extra at all. The insert operations do reference extra and pass it to _mongoc_write_command_init_insert as the cmd_opts, which is likely also dead code (to be removed in CDRIVER-4199 when introducing the top-level comment option).


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