-
Notifications
You must be signed in to change notification settings - Fork 532
RUBY-3520 Sort option for updateOne and replaceOne #2938
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds sort option support for updateOne and replaceOne operations, allowing MongoDB users to specify which document should be updated/replaced when multiple documents match the filter criteria. The sort option determines the order in which documents are considered, with the first document in the sort order being selected for the operation.
- Adds sort option parameter handling to updateOne and replaceOne methods
- Includes test coverage for both standalone operations and bulk write operations
- Supports the new MongoDB 8.0+ server feature with appropriate version checks
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
spec/spec_tests/data/crud_unified/updateOne-sort.yml | Test specification for updateOne with sort option |
spec/spec_tests/data/crud_unified/replaceOne-sort.yml | Test specification for replaceOne with sort option |
spec/spec_tests/data/crud_unified/bulkWrite-updateOne-sort.yml | Test specification for bulkWrite updateOne with sort option |
spec/spec_tests/data/crud_unified/bulkWrite-replaceOne-sort.yml | Test specification for bulkWrite replaceOne with sort option |
spec/runners/unified/crud_operations.rb | Adds sort parameter handling in test runner for updateOne, replaceOne, and bulk operations |
lib/mongo/collection/view/writable.rb | Implements sort option in updateOne and replaceOne methods with documentation |
lib/mongo/collection.rb | Adds documentation for sort option in collection-level methods |
lib/mongo/bulk_write/transformable.rb | Adds sort option support to bulk write transformations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.