Conversation
* PHPC-2495, PHPC-2490, PHPC-2491, PHPC-2492: BulkWriteCommand ctor and ops * PHPC-2494: BulkWriteCommandResult and BulkWriteCommandException It was possible to reuse WriteConcernError and WriteError with slight changes to their init functions. * Include missing header in WriteResult.h This was not necessary for compilation, but it makes the header internally consistent. * PHPC-2493: Manager and Server::executeBulkWriteCommand() * PHPC-2494: Handle null error fields in BulkWriteCommandResult Always return arrays for writeErrors and writeConcernErrors * PHPC-2494: Return writeErrors as an associative array * PHPC-2493: Revise error handling for mongoc_bulkwrite_execute * Consistent WriteError and WriteConcernError parsing for bulk write results * BulkWriteCommand tests * clang-format * Remove BulkWriteCommandResult::getServer() Per CDRIVER-5843, libmongoc does not consistently populate this field. It also isn't required by the spec, so omit it for now. * Check for _id extraction before appending insert * Regenerate BulkWriteCommandException arginfo * PHPC-2493: Relocate writeConcern option to executeBulkWriteCommand() * Parse sort option for replaceOne and updateOne * BulkWriteCommand::replaceOne() need not accept root-level arrays * Preserve empty documents for verbose results and error reply Result maps should only be null if verboseResults=false. Additionally, the error reply document can default to an empty document on error (as it is in libmongoc). * PHPC-2494: Relocate error fields to BulkWriteCommandException Revise the stubs to reflect that executeBulkWriteCommand() always returns a BulkWriteCommandResult. If the result is unacknowledged, that is reported via isAcknowledged() and other methods can throw, which is consistent with WriteResult for the legacy bulk write API. If the result is empty on error (i.e. no writes were successful), BulkWriteCommandException::$partialResult is left unset. * Throw BulkWriteCommandException directly for server errors This also ensures that BulkWriteCommandException uses the original server-side error code and message (if available) for top-level errors. * Check for empty error_reply instead of NULL mongoc_bulkwriteexception_errorreply() always returns an initialized document, but it may be empty. This ensures that an InvalidArgumentException is not unnecessarily proxied behind a BulkWriteCommandException.
alcaeus
approved these changes
May 7, 2025
GromNaN
commented
May 7, 2025
Comment on lines
+22
to
+38
| object(MongoDB\Driver\BulkWriteCommand)#%d (%d) { | ||
| ["bypassDocumentValidation"]=> | ||
| bool(true) | ||
| ["comment"]=> | ||
| string(3) "foo" | ||
| ["let"]=> | ||
| object(stdClass)#%d (%d) { | ||
| ["foo"]=> | ||
| int(1) | ||
| } | ||
| ["ordered"]=> | ||
| bool(true) | ||
| ["verboseResults"]=> | ||
| bool(true) | ||
| ["session"]=> | ||
| NULL | ||
| } |
This comment was marked as duplicate.
This comment was marked as duplicate.
Sorry, something went wrong.
Comment on lines
+22
to
+38
| object(MongoDB\Driver\BulkWriteCommand)#%d (%d) { | ||
| ["bypassDocumentValidation"]=> | ||
| bool(true) | ||
| ["comment"]=> | ||
| string(3) "foo" | ||
| ["let"]=> | ||
| object(stdClass)#%d (%d) { | ||
| ["foo"]=> | ||
| int(1) | ||
| } | ||
| ["ordered"]=> | ||
| bool(true) | ||
| ["verboseResults"]=> | ||
| bool(true) | ||
| ["session"]=> | ||
| NULL | ||
| } |
Member
Author
There was a problem hiding this comment.
The BulkWriteCommand doesn't expose the list of operations when using var_dump or xdebug. There is no way to inspect its contents without executing it and using a subscriber to get the raw command.
I think the executed property should also be exposed, as it cannot be executed multiple times.
Member
There was a problem hiding this comment.
Adding executed would make sense if we have the information already. As the operations list could potentially be big, I'd rather not expose it in the debug output.
alcaeus
added a commit
that referenced
this pull request
Jun 12, 2025
* v2.1: (37 commits) Back to -dev Package 2.1.0 PHPC-2555: Stop testing with MongoDB 4.0 (#1827) PHPC-2510 Install evergreen tools using git submodule (#1797) Bump to libmongoc 1.30.4 (#1822) Feature: Client Bulk Write (#1818) Mention Serializable/Unserializable types in upgrade guide (#1805) Back to -dev Package 2.0.0 Master is now 2.1-dev PHPC-2536: Remove run-ocsp-responder.sh (#1802) PHPC-2536: Migrate to common OCSP responder script (#1800) 1.x is now 1.22.0dev PHPC-2485: Remove WriteConcern and ReadPreference from execute method arginfo (#1783) PHPC-2497: BulkWriteException stub should inherit ServerException (#1784) PHPC-2441: Remove deprecated Manager constructor options (#1719) PHPC-990: Strict type validation for boolean URI options (#1713) PHPC-2440: Remove deprecated Query constructor options (#1707) PHPC-2459: Remove support for float arg in UTCDateTime ctor (#1709) Remove obsolete test ...
alcaeus
added a commit
that referenced
this pull request
Jan 21, 2026
* v2.1: (48 commits) Back to -dev Package 2.1.4 PHPC-2637: Update to libmongoc 1.30.6 (#1882) (#1887) Back to -dev Package 2.1.3 Back to -dev Package 2.1.2 PHPC-2617: Support PHP 8.5 (#1871) PHPC-2613: Test x509 authentication on Atlas (#1858) Back to -dev Package 2.1.1 Back to -dev Package 2.1.0 PHPC-2555: Stop testing with MongoDB 4.0 (#1827) PHPC-2510 Install evergreen tools using git submodule (#1797) Bump to libmongoc 1.30.4 (#1822) Feature: Client Bulk Write (#1818) Mention Serializable/Unserializable types in upgrade guide (#1805) Back to -dev Package 2.0.0 ...
alcaeus
added a commit
that referenced
this pull request
Jan 28, 2026
* v2.1: (50 commits) Back to -dev Package 2.1.5 Back to -dev Package 2.1.4 PHPC-2637: Update to libmongoc 1.30.6 (#1882) (#1887) Back to -dev Package 2.1.3 Back to -dev Package 2.1.2 PHPC-2617: Support PHP 8.5 (#1871) PHPC-2613: Test x509 authentication on Atlas (#1858) Back to -dev Package 2.1.1 Back to -dev Package 2.1.0 PHPC-2555: Stop testing with MongoDB 4.0 (#1827) PHPC-2510 Install evergreen tools using git submodule (#1797) Bump to libmongoc 1.30.4 (#1822) Feature: Client Bulk Write (#1818) Mention Serializable/Unserializable types in upgrade guide (#1805) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
replaceOne,updateManyanddeleteMany#1820