-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Save data and included related data together with one call #1586
Comments
I'll be looking into these use cases as part of |
@alFReD-NSH I have a similar problem but for me this is not only if I update but also when I create the object initially. So in your example, the Also I would like to know how I can set the embedded property at all then? |
@vanthome Currently
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the |
I added this functionality through a mixing method, checkout the code: |
Basically what I'm looking is that, given I have the following models:
I should be able to save(create or update) the following data:
Which will also create the personBelongings entry. This makes my life much easier as, when I query with
include: 'belongings'
, I can just modify and save in one command. But it looks like I have to remove the old belongings(on update) and add the new ones one by one.We have more than a few of these cases in our project. I can write some code to abstract this pattern and reduce it to one, but I believe this code belongs in loopback code base and not my project codebase.
Note that this has been asked before on mailing list before:
https://groups.google.com/forum/#!searchin/loopbackjs/save$20related/loopbackjs/eECzHEa7MlI/-7Maqm1p4UUJ
https://groups.google.com/forum/#!searchin/loopbackjs/save$20related/loopbackjs/sKNauY9jv00/uI8dD77YGygJ
https://groups.google.com/forum/#!searchin/loopbackjs/save$20related/loopbackjs/yqpTRkJMzpI/55z31Rd-gB8J
and also on stackoverflow
The text was updated successfully, but these errors were encountered: