I'm trying to filter by null values, but am gettin...
# prisma-client
p
I'm trying to filter by null values, but am getting the following error:
Type '"AnyNull"' is not assignable to type 'JsonNullableFilter | undefined'.
My client configuration looks like this:
generator client {
provider        = "prisma-client-js"
previewFeatures = ["filterJson", "interactiveTransactions"]
}
I have a postgresql database, my prisma client version is 3.5.0, and the field I am trying to filter by is an optional JSON field. the findMany call:
await prisma.chart.findMany({
where: {
oldState: Prisma.AnyNull
},
});
a
Hey Pinja 👋 , Could you try this:
Copy code
await prisma.chart.findMany({
  where: {
    oldState: {
      equals: Prisma.AnyNull
    }
  }
})
p
okay, that worked! thank you. is my prisma client outdated or why doesn't the documentation suggest that? https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-by-null-values
a
That looks like maybe an issue with our docs, I will investigate. Great catch!