Closed cody-ta closed 2 months ago
I disagree that array_contains: "string"
should return any match.
array_contains
implies an exact equal, so the current implementation is right.
However, I'd argue the following should return a match
prisma.document_files.findFirst({
where: {
json_field: {
path: ["data"],
string_contains: "string",
},
},
});
Hey @cody-ta and @alvis, this is expected behavior. Even what you posted @alvis is not expected to work by design. Your path points to an array but you use the string_*
operators. This will yield nothing. If anything, this issue should be converted to a feature request.
If you still need this feature, please open another issue. For now though, I'm closing this one. Thanks for the report anyway 🙏
Bug description
JSON data example:
Using
string_contains
:✅ match.
Using
array_contains
:✅ match.
✅ match.
but
🚫 doesn't match anything.
How to reproduce
Use query like shown.
Expected behavior
Prisma information
Environment & setup
Prisma Version