Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

adonis model preload with condition

const users = await User
  .query()
  .preload('profile', (profileQuery) => {
    profileQuery.where('isActive', true)
  })
Source by docs.adonisjs.com #
 
PREVIOUS NEXT
Tagged: #adonis #model #preload #condition
ADD COMMENT
Topic
Name
3+8 =