Skip to content

Commit 8ed225b

Browse files
authored
Nested objects are encoded incorrectly for MongoDB
Carries over changes from parse-community#8209 to fix encoding of nested objects, specifically dates.
1 parent f86acd7 commit 8ed225b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Adapters/Storage/Mongo/MongoTransform.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,9 @@ function mapValues(object, iterator) {
12431243
const result = {};
12441244
Object.keys(object).forEach(key => {
12451245
result[key] = iterator(object[key]);
1246+
if (result[key] && JSON.stringify(result[key]).includes(`"__type"`)) {
1247+
result[key] = mapValues(object[key], iterator);
1248+
}
12461249
});
12471250
return result;
12481251
}

0 commit comments

Comments
 (0)