How to Handle Case Insensitivity?

This is giving me an error with findFirst.
3 Replies
Wolverine
Wolverine5mo ago
//Fetch a book by name, handling non-existence
async getBook(name) {
try {
return await prisma.book.findFirst({
where: {
title: {
equals: name,
mode: 'insensitive'
}
}
});
} catch (error) {
console.error("Error in getBook: ", error)
return { error };
}
}
//Fetch a book by name, handling non-existence
async getBook(name) {
try {
return await prisma.book.findFirst({
where: {
title: {
equals: name,
mode: 'insensitive'
}
}
});
} catch (error) {
console.error("Error in getBook: ", error)
return { error };
}
}
Unknown argument mode. Did you mean lte? Available options are marked with ?. I am using sqllite. Online says that sqlite handles case insensitivity by default. But if I remove mode, case insensitivity does matter. If I add mode, I get an error. findFirst does not work with mode maybe? But why if so?
David
David5mo ago
No description
Want results from more Discord servers?
Add your server