Skip to content
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

Partial updates #9

Closed
bleonard opened this issue Sep 4, 2015 · 4 comments
Closed

Partial updates #9

bleonard opened this issue Sep 4, 2015 · 4 comments

Comments

@bleonard
Copy link

bleonard commented Sep 4, 2015

say i know the primary key - is there a way to update just a few of the properties?
right now it all goes through create (with the true flag) and it crashes if all the properties are not set.

@alazier
Copy link
Contributor

alazier commented Sep 4, 2015

It should allow you to do a partial update for objects that have already been created. For new objects it should require all objects until we add support for default values. Will do some additional testing to see if I am missing something.

@alazier
Copy link
Contributor

alazier commented Sep 4, 2015

I've added more extensive testing and haven't yet run into issues with partial updating: https://github.com/realm/realm-js/blob/master/tests/RealmTests.js#L117

My guess would be that you are not providing all values when creating an object for the first time which will definitely throw. I'll add support for default values next which should allow you to avoid the issue.

@bleonard
Copy link
Author

bleonard commented Sep 4, 2015

hmmm, ok. i'll let you know if you if see it agian.

@bleonard bleonard closed this as completed Sep 4, 2015
@alazier
Copy link
Contributor

alazier commented Sep 4, 2015

Default values should now work in case it helps: https://github.com/realm/realm-js/blob/master/tests/TestObjects.js#L91

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

No branches or pull requests

2 participants