Make sure we don't treat dot notation keys as topLevel atoms (#3531)

Fixing GeoPoints and Files in _GlobalConfig
This commit is contained in:
Florent Vilmart
2017-02-19 05:07:54 -05:00
committed by Natan Rolnik
parent 6ae0675010
commit 193e5a4278
2 changed files with 47 additions and 1 deletions

View File

@@ -89,6 +89,9 @@ const transformKeyValueForUpdate = (className, restKey, restValue, parseFormatSc
if (timeField && (typeof value === 'string')) {
value = new Date(value);
}
if (restKey.indexOf('.') > 0) {
return {key, value: restValue}
}
return {key, value};
}
@@ -98,7 +101,7 @@ const transformKeyValueForUpdate = (className, restKey, restValue, parseFormatSc
return {key, value};
}
// Handle update operators
// Handle update operators
if (typeof restValue === 'object' && '__op' in restValue) {
return {key, value: transformUpdateOperator(restValue, false)};
}