[CDRIVER-4373] Do not call mongoc_bulk_operation_set_let unnecessarily Created: 29/Apr/22  Updated: 28/Oct/23  Resolved: 05/May/22

Status: Closed
Project: C Driver
Component/s: Bulk API
Affects Version/s: None
Fix Version/s: 1.22.0, 1.22.0-beta0

Type: Task Priority: Minor - P4
Reporter: Jeremy Mikola Assignee: Jeremy Mikola
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-4198 Support 'let' option for multiple CRU... Closed

 Description   

mongoc_collection_create_bulk_operation_with_opts always calls mongoc_bulk_operation_set_let. If the let option was never specified, this is redundant as mongoc_bulk_operation_new already initializes it to an empty BSON document. Instead, we should gate the setter with a bson_empty check:

if (!bson_empty (&bulk_opts.let)) {
   mongoc_bulk_operation_set_let (bulk, &bulk_opts.let);
}



 Comments   
Comment by Githook User [ 05/May/22 ]

Author:

{'name': 'Jeremy Mikola', 'email': 'jmikola@gmail.com', 'username': 'jmikola'}

Message: CDRIVER-4373 do not set bulk let option unnecessarily (#978)
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/b2c2fc566591211fdceb25c26eb6ef35f65660f1

Comment by Jeremy Mikola [ 29/Apr/22 ]

https://github.com/mongodb/mongo-c-driver/pull/978

Comment by Githook User [ 29/Apr/22 ]

Author:

{'name': 'Jeremy Mikola', 'email': 'jmikola@gmail.com', 'username': 'jmikola'}

Message: CDRIVER-4373 do not set bulk let option unnecessarily
Branch: cdriver-4373
https://github.com/mongodb/mongo-c-driver/commit/47808e5f4ba8b8f9b28da3125bb299dc7057feab

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