[CDRIVER-2206] Expose is_default() in public API for read and write concerns Created: 10/Jul/17  Updated: 28/Oct/23  Resolved: 11/Jul/17

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

Type: New Feature Priority: Major - P3
Reporter: Jeremy Mikola 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:
Depends
is depended on by PHPC-976 Create isDefault() method for read an... Closed
is depended on by PHPLIB-261 Omit default read and write concern f... Closed
Related
related to PHPC-834 Add Read, ReadWrite, and Write comman... Closed

 Description   

When parsing a URI, libmongoc always sets a read concern and write concern on the resultant client object (even if the URI includes no such options). It later checks if those properties are default via the private _mongoc_read_concern_is_default() and _mongoc_write_concern_is_default() functions when it needs to decide if the global defaults should be injected into commands.

Since PHPC is not using mongoc_client_read_write_command_with_opts()() and related functions at this time (and cannot until a general mongoc_client_command_with_opts() function is also introduced), application of these global options is handled in PHPLIB. However, PHPLIB currently injects default read and write concerns into its commands. Fixing this requires PHP to have some way to determine if a libmongoc client's read and write concern are actually defaults that should be ignored by PHPLIB.

This missing feature was discovered in 1.7.0-rc0 and will be added in 1.7.0-rc1.



 Comments   
Comment by Ramon Fernandez Marina [ 12/Sep/17 ]

Author:

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

Message:CDRIVER-2206 mongoc_read/write_concern_is_default

New function mongoc_write_concern_is_default determines if any write
concern options have been set, and mongoc_read_concern_is_default checks
if read concern options are set.
Branch:r1.7
https://github.com/mongodb/mongo-c-driver/commit/8fed50154d5d0176cd0166e6d955cbbf2784ac70

Comment by A. Jesse Jiryu Davis [ 11/Jul/17 ]

On r1.7: https://github.com/mongodb/mongo-c-driver/commit/8fed50154d5d0176cd0166e6d955cbbf2784ac70

Comment by Githook User [ 11/Jul/17 ]

Author:

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

Message: CDRIVER-2206 mongoc_read/write_concern_is_default

New function mongoc_write_concern_is_default determines if any write
concern options have been set, and mongoc_read_concern_is_default checks
if read concern options are set.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/82b25b757299ef18235c01979946c639f1db8dbd

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