You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Save data and included related data together with one call #1586
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.
@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 belongings property would just be missing. Can you confirm this?
Also I would like to know how I can set the embedded property at all then?
@vanthome Currently Person.create({ name: 'Farid', category: 'student', belongings: [{ label: 'laptop', type: 'lenovo' }] }); belongings wouldn't be saved. It was set in relations:
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 CODEOWNERS file at the top-level of this repository.
Activity
raymondfeng commentedon Aug 12, 2015
I'll be looking into these use cases as part of
composite modeldesign.vanthome commentedon Apr 28, 2016
@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
belongingsproperty would just be missing. Can you confirm this?Also I would like to know how I can set the embedded property at all then?
faridnsh commentedon Jul 5, 2016
@vanthome Currently
Person.create({ name: 'Farid', category: 'student', belongings: [{ label: 'laptop', type: 'lenovo' }] });belongings wouldn't be saved. It was set in relations:stale commentedon Aug 23, 2017
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.
stale commentedon Sep 6, 2017
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
CODEOWNERSfile at the top-level of this repository.tellex commentedon Feb 28, 2018
I added this functionality through a mixing method, checkout the code:
https://github.com/tellex/createNested/
soon i will create a npm package.