Find
The find
series of APIs are used to query records from the database. It has the following methods:
-
findMany
Find multiple records that match the query criteria.
-
findUnique
Find a single record with a unique criteria.
-
findFirst
Find the first record that matches the query criteria.
-
findUniqueOrThrow
Similar to
findUnique
, but throws an error if no record is found. -
findFirstOrThrow
Similar to
findFirst
, but throws an error if no record is found.
Throughout this section all samples are based on the following ZModel schema:
zenstack/schema.zmodel
Loading...
Basic usage
- Interactive Sample
- Plain Code
Click here to pop out if the embed doesn't load an interactive terminal.
basic.ts
Loading...