findAndModify regression when upserting with sort and new is false

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.0.1
    • Component/s: 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.
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

              Assignee:
              Unassigned
              Reporter:
              David Golden
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: