Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-17650

findAndModify regression when upserting with sort and new is false

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • 3.0.1
    • None
    • None
    • ALL
    • Hide

      Run test code on 2.8 and 3.0 and see which cases change and which stay the same.

      Show
      Run test code on 2.8 and 3.0 and see which cases change and which stay the same.

    Description

      Documentation says:

      for update with upsert: true operation that results in an insertion, if the command also specifies new is false and specifies a sort, the return document has a lastErrorObject, value, and ok fields, but the value field holds an empty document {}.

      This was true for 2.2, 2.4, and 2.6. In 3.0, the return document value field is null, just as in the case without sort. This is not documented in the reference docs, in the release notes, or in the compatibility notes.

      The new behavior is more consistent between the "with sort" and "without sort" cases, so if we keep it, the docs and compatibility notes need to be changed.

      Attachments

        Activity

          People

            Unassigned Unassigned
            david.golden@mongodb.com David Golden
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: