Skip to content

Instantly share code, notes, and snippets.

@koskimas
Created November 18, 2019 08:22
Show Gist options
  • Select an option

  • Save koskimas/a613ce374b29129a71e2e2b190976634 to your computer and use it in GitHub Desktop.

Select an option

Save koskimas/a613ce374b29129a71e2e2b190976634 to your computer and use it in GitHub Desktop.
await Person.query()
.joinRelated('children(isFemale, hasPets, isJennifer)')
.modifiers({
hasPets(query: QueryBuilder<Person>): void {
query.whereExists(Person.relatedQuery('pets'))
},
isJennifer(query: QueryBuilder<Person>): void {
query.modify('findByName', 'Jennifer')
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment