-
Bug descriptionI use Prisma with MongoDB. const user = await prisma.user.findFirst({
where: {
OR: [
{
username: {
equals: username,
mode: 'insensitive'
}
},
{
email: {
equals: username,
mode: 'insensitive'
}
},
]
},
select: {
username: true,
email: true,
password: true,
role: true,
}
}) How to reproduceYou can have a test with https://test-prisma-login.vercel.app/ Expected behaviorNo response Prisma informationgenerator client {
provider = "prisma-client-js"
}
datasource db {
// MongoDB: ZunicMC > ZunicWeb
provider = "mongodb"
url = env("DATABASE_URL")
}
model User {
id String @id @default(auto()) @map("_id") @db.ObjectId
username String @unique
email String @unique
password String
role Role @default(USER)
profile Profile?
}
model Profile {
id String @id @default(auto()) @map("_id") @db.ObjectId
user User @relation(fields: [userId], references: [id])
userId String @db.ObjectId @unique
}
enum Role {
USER
ADMIN
OWNER
} Environment & setup
Prisma Version
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
What is the problem you found in that code? |
Beta Was this translation helpful? Give feedback.
-
The code execute with a long time, it reach the execution duration limit of Vercel plan. |
Beta Was this translation helpful? Give feedback.
Do you have to whitelist the requesting IP on the MongoDB side?
No logs on Vercel?