How to build a query with multi level relationship #1571
-
Hello ! I have a user model with relationship with education model @hasOne(() => Education,{
localKey: 'id',
foreignKey: 'uid'
})
public education: HasOne<typeof Education>
await User.query().preload('education').where education is ABC How to write query with where for find a specific education category. |
Beta Was this translation helpful? Give feedback.
Answered by
thetutlage
Sep 8, 2020
Replies: 1 comment 9 replies
-
Covered in the docs https://preview.adonisjs.com/guides/model-relations/introduction#relationship-constraints |
Beta Was this translation helpful? Give feedback.
9 replies
Answer selected by
pk4all
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Covered in the docs https://preview.adonisjs.com/guides/model-relations/introduction#relationship-constraints