capabilities.work

Client List and Count Records

A 2-step recipe with Prisma. We can help you get access.

Recipe · 2 steps

Client List and Count Records

with Prisma
Works with AI assistants

Count records matching a filter and then list the first page of matches.

  1. Count how many records match the supplied filter so pagination can be sized before fetching any rows.
  2. Fetch the first page of records matching the same filter, ordered and limited by the supplied take value.
What you'll need to have ready
  • model: The Prisma model name to query (e.g. user, post).
  • where: JSON-encoded filter conditions using Prisma query operators.
  • orderBy: JSON-encoded sort specification with field names and asc/desc.
  • take: Number of records to return in the first page.
For your developer

Arazzo workflow prisma:list-and-count-records, 2 operations: count → findMany. Specs on APIs.io.