Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Prisma · Module

findMany

findMany retrieves a list of records for a Prisma model. Use query arguments to filter, sort, paginate, or shape the returned data.

How it works

Call a model's findMany method to retrieve multiple records. Supply optional query arguments such as filters, ordering, pagination, and field selection; the result is an array, including an empty array when no records match.

Syntax

prisma.<model>.findMany(args?)

Parameters

NameTypeDescription
argsFindManyArgsOptional query arguments controlling filtering, ordering, pagination, selected fields, and related data.

Returns

A promise resolving to a list of records for the selected model.

Key points

  • Use it when the query may produce multiple records.
  • Invoke it on a generated model delegate, such as prisma.user.findMany().
  • A findMany result is not a single object, so single-object chaining patterns do not apply.

Common mistakes

  • The result is a list rather than one record, so it cannot be used where a single-object result is required.

Example: Filter and limit records

import { PrismaClient } from "@prisma/client";

const prisma = new PrismaClient();

async function main() {
  const users = await prisma.user.findMany({
    where: { email: { endsWith: "@example.com" } },
    orderBy: { email: "asc" },
    take: 10,
  });
  console.log(users);
}

main().finally(() => prisma.$disconnect());

Queries up to ten users whose email addresses end with the specified domain, ordered alphabetically.

When to use it

Fetch multiple records

Load a collection for a list or dashboard.

Filter records

Apply conditions before returning data.

Sort and limit results

Control result order and quantity.

Interview questions

QWhat does findMany return?

findMany retrieves multiple records and returns them as a list. Query arguments can constrain which records are returned and how they are shaped.

Follow-up: How would you retrieve one record instead? Use a single-record operation such as findUnique or findFirst, depending on whether the lookup uses a unique field.

QHow do you constrain a findMany query?

Pass filtering and result-shaping options in the argument object, then await the returned promise. For example, where restricts records, while orderBy and take control ordering and quantity.

Follow-up: How can related records be included? Add relation selections through the query's supported relation-selection arguments, while choosing the appropriate result shape.

QWhen should findMany be used instead of a single-record query?

The operation is appropriate when the application expects zero or more records. It returns a list even when there is only one match, unlike operations designed to return a single object.

Follow-up: Why does this matter for chaining? Operations requiring a single object cannot chain directly from a list-producing findMany call.

  • findUnique
  • findFirst
  • where
  • orderBy
  • take
  • select
  • include

Source: Prisma Client API. Checked 2026-10-16.