Closed
Description
Our team has been bitten many times by the quirky merge behavior:
obj.set('foo', {one: 1, two: { a: 'a', b: 'b' }});
await obj.save(null);
obj.set('foo', {two: { b: 'b' }});
await obj.save(null);
console.log(obj.get('foo')); // { one: 1, two: { b: 'b' }}
First-level keys in attribute objects cannot be removed, only set to null
. We have to completely unset('foo'), save, and re-set it to be assured it has the exected value.
This behavior isn't documented in Object.set.
Metadata
Metadata
Assignees
Labels
No labels