MongoStorageAdapter.findOneAndUpdate returns Parse Object (#3053) (#3064)

This commit is contained in:
Glen Tregoning
2016-11-20 06:02:49 -08:00
committed by Florent Vilmart
parent 4ea455b20a
commit 1eff210a51
2 changed files with 50 additions and 2 deletions

View File

@@ -310,7 +310,7 @@ export class MongoStorageAdapter {
const mongoWhere = transformWhere(className, query, schema);
return this._adaptiveCollection(className)
.then(collection => collection._mongoCollection.findAndModify(mongoWhere, [], mongoUpdate, { new: true }))
.then(result => result.value);
.then(result => mongoObjectToParseObject(className, result.value, schema));
}
// Hopefully we can get rid of this. It's only used for config and hooks.