Created
November 16, 2019 18:16
-
-
Save koskimas/b880a4164e79e079bc898334a4c1f04f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Note that the following query isn't executed! There's no `await`. | |
| const jennifers = Actor.query().where('firstName', 'Jennifer') | |
| // This is the only query that gets executed. `jennifers` query is built into | |
| // the SQL as a subquery. | |
| const movies = await Actor.relatedQuery('movies') | |
| .for(jennifers) | |
| .where('genre', 'action') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment