-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 0.2.0
-
Component/s: None
-
None
While implementing the "FindOneAndUpdate when no documents match with upsert returning the document before modification" test case for PHPLIB, I came across an inconsistency among server versions. This also applies to the corresponding FindOneAndReplace test
The findAndModify command returns an empty BSON document on 2.4 and 2.6, while null is returned on 3.0. I couldn't find a specific SERVER ticket to cross-reference here, but I know this was the result of some refactoring (possibly related to SERVER-17372). Solving this will likely require manual inspection of lastErrorObject.updatedExisting.