Skip to content
masterclass Buddy

Prisma · Pipe

distinct

Use Prisma Client's distinct option to remove duplicate records by one or more fields. Combine it with where to filter records and select to control the returned fields.

Last updated

Syntax

await prisma.user.findMany({ distinct: ["city", "country"] })

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • findMany
  • findFirst
  • select
  • where
  • nativeDistinct
  • UserDistinctFieldEnum

Source: Prisma Client API (Prisma ORM v7). Checked 2026-11-03.