Update model relation #2832
Vishwas-verma
started this conversation in
General
Replies: 1 comment 1 reply
-
When you want to query related model, you should do something like this: const identity = await driver.related('identity').query() This will return you an array of related models, the first one is yours, you can call something like this: const identity = await driver.related('identity').query().first() This will return just one instance. More docs info here. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hye,
Driver and Identity has one to one relation .
Presently I am forcefully converting relationship Instance to LucidRow and then applying merge but it seems its not converting to LucidRow,how to do it so that I can use merge ?
Error
Is there any other way to update relationship model in adonisJS ?
Beta Was this translation helpful? Give feedback.
All reactions