Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…4917) In addition to the regular operators that translate to a real SQL operator expression (e.g. `>=`), you can also use the following collection operators: | operator | description | |----------|-----------------------------------------------------------------| | `$some` | Finds collections that have some record matching the condition. | | `$none` | Finds collections that have no records matching the condition. | | `$every` | Finds collections where every record is matching the condition. | This will be resolved as a subquery condition: ```ts // finds all authors that have some book called `Foo` const res1 = await em.find(Author, { books: { $some: { title: 'Foo' } }, }); // finds all authors that have no books called `Foo` const res2 = await em.find(Author, { books: { $none: { title: 'Foo' } }, }); // finds all authors that have every book called `Foo` const res3 = await em.find(Author, { books: { $every: { title: 'Foo' } }, }); ``` The condition object can be also empty: ```ts // finds all authors that have at least one book const res1 = await em.find(Author, { books: { $some: {} }, }); // finds all authors that have no books const res2 = await em.find(Author, { books: { $none: {} }, }); ``` Closes #2916
- Loading branch information
Showing
11 changed files
with
350 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.