is there a way to search in a json field in the wh...
# orm-help
d
is there a way to search in a json field in the where clause? the only options that are available:
equals
and
not
d
yeah, i just saw that 😄 is it also possible to filter on any key because the structure of the JSON is not consistent
r
Yeah it is.
d
how?
r
It’s provided in the link above. Using the
path
property you can perform a check on any key inside the JSON doc.
d
sorry, what I meant is I want to search in all of the keys because the JSON structure is not the same for every field. I dont want to specify a field, because maybe field
A
is available in record 1 but record 2 and 3 use
B
something like
path: ['*']
is that possible?
r
Is that supported by Postgres? If not, then I don’t think Prisma will. If it is, then do create a feature request here so that we can look into this. As for a workaround, you can use the
OR
operator to specify the amount of fields you require.