cipas
cipas
PPrisma
Created by cipas on 8/29/2024 in #help-and-questions
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.
2 replies