Skip to content

Instantly share code, notes, and snippets.

@glommer
Last active June 14, 2022 09:48
Show Gist options
  • Save glommer/37b8dec5d51af76f3a238c33f12a5ae0 to your computer and use it in GitHub Desktop.
Save glommer/37b8dec5d51af76f3a238c33f12a5ae0 to your computer and use it in GitHub Desktop.
// 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