if you are looking for a unique value that would bring you a single result you can use findFirst as well. which would give you Object instead of Array. findMany returns an Array even though you are looking for a unique value.

const users = await prisma.user.findFirst({
  where: {OR: [{username},{email}]}
});
Answer from Bora ALAP on Stack Overflow
🌐
Prisma
prisma.io › home › crud › crud › crud › crud
CRUD (Reference) | Prisma Documentation
// By unique field const user = await prisma.user.findUnique({ where: { email: "elsa@prisma.io" }, }); // By ID const user = await prisma.user.findUnique({ where: { id: 99 }, }); ... const user = await prisma.user.findFirst({ where: { posts: { some: { likes: { gt: 100 } } } }, orderBy: { id: "desc" }, }); // Single field filter const users = await prisma.user.findMany({ where: { email: { endsWith: "prisma.io" } }, }); // Multiple conditions with OR/AND const users = await prisma.user.findMany({ where: { OR: [{ name: { startsWith: "E" } }, { AND: { profileViews: { gt: 0 }, role: "ADMIN" } }], }, }); // Filter by related records const users = await prisma.user.findMany({ where: { email: { endsWith: "prisma.io" }, posts: { some: { published: false } }, }, });
🌐
Prisma
prisma.io › home › prisma client api › prisma client api › prisma client api
Prisma Client API | Prisma Documentation
Prisma Client's dataloader automatically batches findUnique() queries with the same select and where parameters.
Discussions

How to exactly use FindUnique with array (aka FindMany)
Okay, so I have prisma model like that, aka student refers to a lot of points (1 to many?) like 1 User and a lot of his posts in prisma examples model umo_student { person_ptr_id Int @id @default(a... More on github.com
🌐 github.com
2
1
MongoDB `findUnique()` or `findUniqueOrThrow()` leads to COLLSCAN if multiple queries happen at the same time
Bug description in mongodb a simple findUnique or findUniqueOrThrow can lead to a colscan if multiple queries to the same collection happen at the same time: prisma.user .findUnique({ where: { id: "some-id" }, select: { roles: true, }, }... More on github.com
🌐 github.com
29
January 25, 2024
Allow findUnique to accept more than one search parameter
Problem Currently findUnique function only accepts one parameter when where is called, I believe it could be better if this function accepted more than one parameter to search, the Prisma docs reco... More on github.com
🌐 github.com
7
April 9, 2021
Prisma 2 Documentation on where clause with multiple conditions in update and delete statements
Prisma 2 Documentation on where clause with multiple conditions in update and delete statements More on github.com
🌐 github.com
9
31
🌐
Prisma
prisma.io › home › relation queries › relation queries › relation queries › relation queries
Relation queries (Concepts) | Prisma Documentation
Invalid `prisma.user.findUnique()` invocation: { where: { id: 19 }, select: { ~~~~~~ email: true }, include: { ~~~~~~~ posts: { select: { title: true } } } } Please either use `include` or `select`, but not both at the same time.
🌐
GitHub
github.com › prisma › prisma › issues › 20533
findUnique "where" clause allows every key of a model, not only unique keys. · Issue #20533 · prisma/prisma
The findUnique method now allows every key inside the model to be looked up instead of only the unique keys. model Customer { customerId Int @id @default(autoincrement()) userMasterId Int @unique fullName String phone String userMaster U...
Author   prisma
🌐
DEV Community
dev.to › this-is-learning › its-prisma-time-select-3lie
It's Prisma Time - Select - DEV Community
January 11, 2022 - const post = await prisma.post.findUnique({ where: { id: 1, }, }); Ok, I think that's all for today. In the next article we are going to see how to paginate the results. See you soon guys! Bye Bye! Here you can find the code of this article · Subscribe · For further actions, you may consider blocking this person and/or reporting abuse ·
Find elsewhere
🌐
GitHub
github.com › prisma › prisma › issues › 22812
MongoDB `findUnique()` or `findUniqueOrThrow()` leads to COLLSCAN if multiple queries happen at the same time · Issue #22812 · prisma/prisma
January 25, 2024 - in mongodb a simple findUnique or findUniqueOrThrow can lead to a colscan if multiple queries to the same collection happen at the same time: prisma.user .findUnique({ where: { id: "some-id" }, select: { roles: true, }, }) prisma.user .findUnique({ ...
Author   prisma
🌐
GitHub
github.com › prisma › prisma › issues › 6486
Allow findUnique to accept more than one search parameter · Issue #6486 · prisma/prisma
April 9, 2021 - Currently findUnique function only accepts one parameter when where is called, I believe it could be better if this function accepted more than one parameter to search, the Prisma docs recommends using findFirst but this function calls findMany ...
Author   prisma
🌐
MCP Servers
mcpservers.org › home › agent skills library › prisma-client-api-model-queries
prisma-client-api-model-queries | Agent Skills Library
const user = await prisma.user.findUniqueOrThrow({ where: { id: 1 } }) // Throws PrismaClientKnownRequestError if not found · Find first matching record: const user = await prisma.user.findFirst({ where: { role: 'ADMIN' }, orderBy: { createdAt: 'desc' } }) const user = await prisma.user.findFirstOrThrow({ where: { role: 'ADMIN' } }) Find multiple records: const users = await prisma.user.findMany({ where: { role: 'USER' }, orderBy: { name: 'asc' }, take: 10, skip: 0 }) Create a single record: const user = await prisma.user.create({ data: { email: '[email protected]', name: 'Alice' } }) const u
🌐
Prisma
prisma.io › home › select fields › select fields › select fields › select fields
Select fields | Prisma Documentation
Learn how to use select and include in Prisma Client to return only the fields and relations you need.
🌐
GitHub
github.com › prisma › prisma › issues › 17030
Using findUnique on 4.8.0 with nested `where` and `include` produces an object that doesn't include entities you specify in `include` · Issue #17030 · prisma/prisma
December 27, 2022 - Use findUnique() and provide it with where and include, where must depend on multi column unique constraint. The resulting object must contain data I specified in include · Schema can be found here · Using Prisma 4.8.0 ·
Author   prisma
🌐
GitHub
github.com › prisma › prisma › issues › 4438
Running multiple findUnique's in parallel causes both to return null · Issue #4438 · prisma/prisma
December 1, 2020 - const firstUnique = prisma.availability.findUnique({ where: { propertyId_date_status: { propertyId: property.id, status: AvailabilityStatus.AVAILABLE, date: targetDate, } }, }); const secondUnique = prisma.availability.findUnique({ where: { propertyId_date_status: { propertyId: property.id, status: AvailabilityStatus.AVAILABLE, date: targetDate, } }, }); const res = await Promise.all([firstUnique, secondUnique]) console.log(res); <-- [null, null]
Author   prisma
🌐
Medium
medium.com › @SieghartSWE › how-to-check-many-to-many-relationships-in-prisma-with-findunique-and-composite-keys-16f81b0d2a73
How to Check Many-to-Many Relationships in Prisma with findUnique and Composite Keys | by Yanuar Prayoga | Medium
July 12, 2025 - In this article, we’ll look at how to use Prisma’s findUnique() method with a composite key to check if a many-to-many relationship already exists — a useful step before deleting or adding a relationship.
🌐
Answer Overflow
answeroverflow.com › m › 1192456882288341032
Suggested way to query equivalent to prisma's findUnique - Drizzle Team
January 4, 2024 - await prisma.someTable.findUnique({ where: { field1_field2_field3: { // This type requires all 3 specified field1: 'asdf', field2: 'asdf', field3: 'asdf' } } }); Suggested way to use multiple drivers · DTDrizzle Team / help3y ago · Suggested way to do nested inserts ·