Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-1492

Support sort option for replaceOne and updateOne operations

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.21.0
    • Affects Version/s: None
    • Component/s: CRUD
    • Hide

      DRIVERS-2822:
      Summary of necessary driver changes

      Commits for syncing spec/prose tests
      (and/or refer to an existing language POC if needed)

      Context for other referenced/linked tickets

      •  
      Show
      DRIVERS-2822: Summary of necessary driver changes Add a sort option to updateOne and replaceOne operations so if it matches more than one candidate document the first one matched by the sort order will be updated. The upstream server changes are at  https://jira.mongodb.org/browse/SERVER-78140 . See example change in the Python driver: https://github.com/mongodb/mongo-python-driver/commit/6f4258c1cdb95f6fe624a66760a66423048b6884 Commits for syncing spec/prose tests (and/or refer to an existing language POC if needed) https://github.com/mongodb/specifications/commit/da8e120514fd5e7a5934513f4fb7a63c7cadbb43 adds spec tests for updateOne, replaceOne, collection-level bulk write, and the bulkWrite command. https://github.com/mongodb/specifications/commit/24817a5caa0526725d480f9a8b3fbb8714507311 adds skips for clientBulkWrite tests on Serverless. Context for other referenced/linked tickets  
    • Needed
    • Hide

      1. Introduces a "sort" option to Collection::updateOne, Collection::replaceOne(), and the respective operations within Collection::bulkWrite(). The option is a document type (array or object).
      2. No example syntax should be necessary, as we don't have that for "sort" options on other methods.
      3. This change is applicable to PHPLIB 1.21+ (and requires PHPC 1.21 for underlying support).

      Show
      1. Introduces a "sort" option to Collection::updateOne , Collection::replaceOne() , and the respective operations within Collection::bulkWrite() . The option is a document type (array or object). 2. No example syntax should be necessary, as we don't have that for "sort" options on other methods. 3. This change is applicable to PHPLIB 1.21+ (and requires PHPC 1.21 for underlying support).

      This ticket was split from DRIVERS-2822, please see that ticket for a detailed description.

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            dbeng-pm-bot TPM Jira Automations Bot
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 1 week
                1w
                Remaining:
                Remaining Estimate - 1 week
                1w
                Logged:
                Time Spent - Not Specified
                Not Specified