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

Pass multiple foreign ids to __link__model #2276

Closed
ambrt opened this issue May 1, 2016 · 2 comments
Closed

Pass multiple foreign ids to __link__model #2276

ambrt opened this issue May 1, 2016 · 2 comments
Assignees
Labels

Comments

@ambrt
Copy link
Contributor

ambrt commented May 1, 2016

Hi

I can link one existing item of related model to instance with:
instance.__link__model(1, cb);

Is it possible to do one call with multiple foreign ids?
Or pass array of related instances to it (like linking tags instances to item instance)

@jannyHou
Copy link
Contributor

jannyHou commented May 2, 2016

Is it possible to do one call with multiple foreign ids?

@ambrt we support multiple primary key but not foreign key, please check issue #2080 and keep track of further discussion there.

Or pass array of related instances to it (like linking tags instances to item instance)

I believe you are looking for a embedsMany relationship from item to tags, please check our doc for more details:
https://docs.strongloop.com/display/LB/Embedded+models+and+relations#Embeddedmodelsandrelations-EmbedsManywithbelongsTo

@ambrt
Copy link
Contributor Author

ambrt commented May 3, 2016

Ok @jannyHou, thanks for info.

@ambrt ambrt closed this as completed May 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants