Skip to content

Conversation

comandeo-mongo
Copy link
Contributor

No description provided.

@comandeo-mongo comandeo-mongo marked this pull request as ready for review September 1, 2025 11:58
@Copilot Copilot AI review requested due to automatic review settings September 1, 2025 11:58
@comandeo-mongo comandeo-mongo requested a review from a team as a code owner September 1, 2025 11:58
@comandeo-mongo comandeo-mongo requested a review from jamis September 1, 2025 11:58
Copy link

@Copilot Copilot AI left a 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.

comandeo-mongo and others added 2 commits September 1, 2025 17:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
jamis
jamis previously approved these changes Sep 2, 2025
@comandeo-mongo comandeo-mongo merged commit 9ce8f90 into mongodb:master Sep 8, 2025
200 of 202 checks passed
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.

2 participants