Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPLIB-1492: Support sort option for updateOne and replaceOne #1605

Merged
merged 2 commits into from
Feb 25, 2025

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Feb 24, 2025

https://jira.mongodb.org/browse/PHPLIB-1492

Addresses both single-statement updates and bulk writes.

This will depend on mongodb/mongo-php-driver#1794 being merged.

Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +432 to +434
if (isset($args[2]['sort']) && $args[2]['multi']) {
throw new InvalidArgumentException(sprintf('"sort" option cannot be used with $operations[%d]["%s"]', $i, $type));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted that the multi option cannot true for replaceOne, that why the validation is only for updateMany and updateOne.

Addresses both single-statement updates and bulk writes.
@jmikola jmikola marked this pull request as ready for review February 25, 2025 15:28
@jmikola jmikola requested a review from a team as a code owner February 25, 2025 15:28
@jmikola jmikola merged commit 85447eb into mongodb:v1.x Feb 25, 2025
31 checks passed
@jmikola jmikola deleted the 1.x-phplib-1492 branch February 25, 2025 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants