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