-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.2.0-alpha3
-
Component/s: None
-
None
mongoc_client_read_write_command_with_opts() includes logic to inject the mongo_client_t's read concern, read preference, and write concern if said options are not specified in the BSON options (not the same as the command document). Since PHPLIB currently passes in these options in the command document, a simple migration to mongoc_client_read_write_command_with_opts() would see duplicate fields injected by libmongoc. Therefore, PHPC's executeCommand() methods will need to extract these fields from command documents and supply them in the separate BSON options document.
When combined with PHPLIB-261, this will ensure that only PHPC and libmongoc are responsible for injecting client-level options into commands.
Lastly, it should be noted that mongoc_client_read_write_command_with_opts() does not inspect a command document to determine whether it is a read or write command. The default behavior will see read concern and write concern always injected from mongo_client_t if not provided in BSON options. Therefore, the PHP driver may need to implement some detection on its own to determine whether to call mongoc_client_read_command_with_opts() or mongoc_client_write_command_with_opts() on a per-command basis.
- depends on
-
CDRIVER-1527 Add mongoc_client_[read|write|read_write]_command_with_opts
- Closed
-
CDRIVER-2207 Introduce generic mongoc_client_command_with_opts() function
- Closed
- is depended on by
-
PHPLIB-317 Add Read, ReadWrite, and Write command execute methods to Database
- Closed
-
PHPC-965 Determine how to include transaction IDs in write commands
- Closed
-
PHPLIB-316 Migrate Operation classes to use read and write command methods
- Closed
- is related to
-
CDRIVER-2206 Expose is_default() in public API for read and write concerns
- Closed
-
PHPC-1042 Support options array for BulkWrite, Command, and Query execute methods
- Closed
-
PHPC-783 Use mongoc_collection_find_with_opts() for Query execution
- Closed
-
PHPC-796 Use flexible opts for BulkWrite update and delete
- Closed
-
PHPC-1037 Upgrade bundled libmongoc and libbson to 1.9
- Closed
-
PHPLIB-261 Omit default read and write concern from commands
- Closed
- related to
-
CDRIVER-2410 _mongoc_client_command_with_opts omits client write concern for findAndModify on 3.2
- Closed
-
PHPC-1072 phongo_execute_command() leaks BSON reply on error
- Closed
-
PHPC-2303 Correctly document option inheritance rules for execute methods
- Closed
-
PHPC-578 Expose result document for failed commands
- Closed
-
PHPC-980 Implement Drivers Sessions API
- Closed