PrismaP
Prisma2y ago
1 reply
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
}


with the following data:

[
 {
  id: 1,
  name: "Asd",
 },
 {
  id: 2,
  name: "asd",
 }
]


doing:

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.
Was this page helpful?