How can i case insensitive check against a usernam...
# orm-help
h
How can i case insensitive check against a username?
Copy code
where: { 
    username: username
}
m
it depends on your underlying provider. you should go through this chapter i believe: https://www.prisma.io/docs/concepts/components/prisma-client/case-sensitivity
h
yeah. but i con't want to match with endsWith or startsWith or contains, i want the exact match of the username, but not taking upper/lowercase letters into considerations.
m
didn’t work?
Copy code
where: {
        username: {
          equals: username,
          mode: 'insensitive',
        },
      },
h
No, i'm getting:
Copy code
error TS2322: Type '{ equals: any; mode: string; }' is not assignable to type 'string'.
r
@Halvor 👋 Case insensitivity will not work with
findUnique
. Only
findFirst
and
findMany
.