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

How to use Array for the "one" in one-to-many relations? #64

Open
igorsantos07 opened this issue Apr 25, 2015 · 0 comments
Open

How to use Array for the "one" in one-to-many relations? #64

igorsantos07 opened this issue Apr 25, 2015 · 0 comments

Comments

@igorsantos07
Copy link

I have a model with a belongsTo relation, that in Parse is an Array column.

However, using model.set('column', [relationModel]) triggers an error: "Assertion Failed: You cannot add a 'undefined' record to the 'hypothesis.risk'. You can only add a 'item' record to this relationship."

I guess this happens because the belongsTo relation specify a model class, but how should we specify those instead? I wanted to use an Array column for a one-to-many relation, so it would load the "one" side instantly - instead of using Pointer, that would make a second request to get the "one" (this is advised in the parse docs).

@igorsantos07 igorsantos07 changed the title How do Array relations works? How to use Array for the "one" in one-to-many relations? Apr 27, 2015
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

1 participant