P
Prisma3mo ago
cipas

Distinct doesn't work for some reason

Hey guys, I need help with something. I have this model
model AnotherModel {
id Int @id @default(autoincrement())
name String
}
model AnotherModel {
id Int @id @default(autoincrement())
name String
}
with the following data:
[
{
id: 1,
name: "Asd",
},
{
id: 2,
name: "asd",
}
]
[
{
id: 1,
name: "Asd",
},
{
id: 2,
name: "asd",
}
]
doing:
findMany({
where: {
name: {
not: "",
mode: "insensitive",
},
},
distinct: ["name"], // for some reason this doesn't work
});
findMany({
where: {
name: {
not: "",
mode: "insensitive",
},
},
distinct: ["name"], // for some reason this doesn't work
});
returns all the results. Any idea what I'm doing wrong ? Thank you.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server