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

findAndModify commands always include new and upsert fields

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.13.0-beta1, 1.13.0
    • Affects Version/s: None
    • Component/s: None
    • None

      With respect to the returnDocument option (mapped to new in outgoing commands) for findAndModify operations, the CRUD spec states:

      This option is sent only if the caller explicitly provides a value. The default is to not send a value.

      Similar guidance is provided for the upsert option.

      PHPLIB defaults both fields to false (along with remove), and always sends them in outgoing commands. We should either consider relaxing the behavior for new and upsert, or amending the CRUD spec to permit this behavior.

      FWIW, the server's own defaults for these options is false and I think it'd unlikely that would ever change (based on previous discussions on update's defaults).

            Assignee:
            aleksandr.rudo@mongodb.com Aleksandr Rudo (Inactive)
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: