Angelo
07/09/2021, 11:16 AMconst application = await prisma.application.findFirst({
where: {
id: applicationId,
tasks: {
array_contains: [{ keyName: taskKeyName }],
},
},
});
basically I want to filter inside the JSON tasks
field (which is an array) for a value inside keyName
but I keep array_contains
is unknown, I've tried to use equals
but I assume that only returns data if all the array key value matches.
I am a bit lost and I'm not sure why it doesn't work 😞Ryan
07/09/2021, 11:47 AMschema.prisma
?Angelo
07/09/2021, 1:25 PMmodel Application {
id String @id @default(uuid())
tasks Json
}
Ryan
07/12/2021, 7:38 AMfilterJson
to the previewFeatures
in your schema.prisma
?
generator client {
provider = "prisma-client-js"
previewFeatures = ["filterJson"]
}
Ryan
07/12/2021, 7:38 AMprisma generate
.
I just tried and it works fine for me.Angelo
07/12/2021, 1:06 PM