Skip to content

Allow disabling object merge behavior #5597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mrclay opened this issue May 15, 2019 · 3 comments
Closed

Allow disabling object merge behavior #5597

mrclay opened this issue May 15, 2019 · 3 comments

Comments

@mrclay
Copy link
Contributor

mrclay commented May 15, 2019

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.

@dplewis
Copy link
Member

dplewis commented May 15, 2019

Is this for Postgres? What version of Parse-Server are you using? I believe this has been fixed.

#5242

@mrclay
Copy link
Contributor Author

mrclay commented May 15, 2019

parse-server 2.8.1 on postgres, so looks like we'll have to get to 3.x. Thanks.

@mrclay mrclay closed this as completed May 15, 2019
@dplewis
Copy link
Member

dplewis commented May 15, 2019

No problem! A lot of PG improvements made.

Can you comment on #5336?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants