Created
January 13, 2020 11:47
-
-
Save B4nan/ff800fac1e60d98e1dcf5662c8f5a3b8 to your computer and use it in GitHub Desktop.
MikroORM 3: strict query typing
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
| // correct query | |
| em.find(Author, { | |
| favouriteBook: { | |
| author: { name: '...' }, | |
| }, | |
| age: { $gte: 40 }, // operators are also supported | |
| }); | |
| // 2 errors will be reported here | |
| em.find(Author, { | |
| favouriteBook: { | |
| author: { born: 'test' }, // string instead of Date | |
| }, | |
| age: { $lte: 'nan' }, // string instead of number | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment