Fix MongoStorageAdapter.findOneAndUpdate to return Parse Object (#3053) #3064
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR resolves the general issue that the response to PUT request to update an object returns the result formatted as a Mongo DB object rather than a parse object. This results for example as dates objects being serialized as strings instead of objects with appropriate keys e.g.
{"__type":"Date","iso":"2016-11-14T07:37:49.838Z"}
.Prior to this fix, responses to an update corrupts the local version of an object on the iOS Parse client (and possibly others).
This also generalizes to responses with objects nested in arrays such as recorded in #3053.