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

When my sharding key have two fields, loopback does not support to locate a model using two fields. #2955

Closed
1 task
elfahxh opened this issue Nov 18, 2016 · 1 comment

Comments

@elfahxh
Copy link

elfahxh commented Nov 18, 2016

Bug or feature request

  • [ x] Bug
  • Feature request

Description of feature (or steps to reproduce if bug)

I created two Models, Model-B is an embedded model in Mode-A, Model-A must have sharding key which have two fields. When I call such related method, Model-A.Model-B.create(), will failed.
The root-cause is that, underline, it will call updateAttributes() of Model-A, while the search filter only have "_id" field, cannot define a combined multiple keys to find Model-A from database. hence, will encounter a failure.

Link to sample repo to reproduce issue (if bug)

Expected result

Actual result (if bug)

Additional information (Node.js version, LoopBack version, etc)

@jannyHou
Copy link
Contributor

@elfahxh We have an issue to track "Supporting composite foreign key in loopback":
#2080

I migrated your comment to that issue and let's keep all discussion there. I am closing this issue as a dup. Thanks for understanding.

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