Adds support for plain object in $add, $addUnique, $remove

This commit is contained in:
Florent Vilmart
2016-03-20 15:16:26 -04:00
parent 24f0fffb41
commit 937dde592f
2 changed files with 51 additions and 5 deletions

View File

@@ -398,6 +398,9 @@ function transformAtom(atom, force, options) {
if (FileCoder.isValidJSON(atom)) {
return (inArray || inObject ? atom : FileCoder.JSONToDatabase(atom));
}
if (inArray || inObject) {
return atom;
}
if (force) {
throw new Parse.Error(Parse.Error.INVALID_JSON,