Reading Data
Counting Records


count returns the number of records that fit a set of filters.

The examples use the following schema:

model Post {
    id        String   @id @default(cuid())
    title     String
    content   String
use prisma::comment;
// Passing no filters will count all records
let all_count: usize = client
// Number of records whose title starts with "Post"
let filtered_count: usize = client