Searching by null returns no results

Given an example model like this:
model Item {
name: String
ownedBy: String?
}
model Item {
name: String
ownedBy: String?
}
When I try and search like this:
prisma.item.findFirst({
where: {
ownedBy: null
}
});
prisma.item.findFirst({
where: {
ownedBy: null
}
});
It returns nothing - while expected result would be to get the first item that isn't owned by anyone.
1 Reply
Prisma AI Help
You decided to hold for human wisdom. We'll chime in soon! Meanwhile, #ask-ai is there if you need a quick second opinion.

Did you find this page helpful?