[SERVER-17650] findAndModify regression when upserting with sort and new is false Created: 18/Mar/15  Updated: 10/Jan/17  Resolved: 18/Mar/15

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 3.0.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: David Golden Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates DOCS-4968 findAndModify no longer changes retur... Closed
Related
Operating System: ALL
Steps To Reproduce:

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

Participants:

 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.



 Comments   
Comment by Charlie Swanson [ 18/Mar/15 ]

Right, sorry. Was just commenting on the DOCS ticket that that also needs to happen. It's on that ticket now.

Comment by David Golden [ 18/Mar/15 ]

It needs to be in the compatibility notes for 3.0, too, not just the reference docs.

Comment by Charlie Swanson [ 18/Mar/15 ]

duplicates DOCS-4968

Generated at Thu Feb 08 03:45:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.