Last active
June 14, 2022 09:48
-
-
Save glommer/37b8dec5d51af76f3a238c33f12a5ae0 to your computer and use it in GitHub Desktop.
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
// model definition | |
export class User extends ChiselEntity { | |
name: string = ""; | |
email: string = ""; | |
age: number = 0; | |
} | |
// endpoint code | |
const user = await User.findOne(user => user.name == "Glauber Costa" && user.age >= 40); | |
return new Response(user?.email ?? "not found"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment