Mongo object to Parse object date serialization - avoid re-serialization of iso of type Date (#3389)
* Mongo object to Parse object date serialization - avoid nested ios * Mongo object to Parse object date serialization * Remove file from previous commit
This commit is contained in:
committed by
Tyler Brock
parent
49dc8df1de
commit
ecf422b2d9
@@ -726,6 +726,11 @@ const nestedMongoObjectToNestedParseObject = mongoObject => {
|
||||
return BytesCoder.databaseToJSON(mongoObject);
|
||||
}
|
||||
|
||||
if (mongoObject.hasOwnProperty('__type') && mongoObject.__type == 'Date' && mongoObject.iso instanceof Date) {
|
||||
mongoObject.iso = mongoObject.iso.toJSON();
|
||||
return mongoObject;
|
||||
}
|
||||
|
||||
return _.mapValues(mongoObject, nestedMongoObjectToNestedParseObject);
|
||||
default:
|
||||
throw 'unknown js type';
|
||||
|
||||
Reference in New Issue
Block a user