You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Postgres users: you should always use path: string[] syntax. Right now we support path: string, but this will be disabled in the future to avoid the expectation that Postgres supports dot notation.
Loving this feature so far! ❤️ The Prisma client documentation specifies that filtering on an object key inside of an array is only currently supported for the MySQL database connector.
Are there plans to expand this to other connectors as well, particularly PostgreSQL?
Reacted by Timo Reichert, daniel-frazier, Sriinnu, Andreas Sundman, Tobias Pieri, PatElder, ThibaultGerrier and AJ
This feature is missing case insensitivity support (at least for PostgreSQL, since I used to specify the mode field to enable it for other field types)
Reacted by daniel-frazier, Firman Jamal, Kay Simons, tkenbo, Nathaniel Quansah, Vlad Turak and songkeys
Great feature. Supporting JSON object containment check (@> in Postgres) would allow me to stop relying on custom SQL for search query filtering. My usecase is querying rows where metadata (a shallow JSONB object with arbitrary keys and non-object values) contains specific subset of key-value pairs.
Reacted by Nicolas Cognaux, Ilshat Safiullin and Luke Melia
Hi. I saw this issue was closed because filterJson is not in preview anymore. But has the feature request "case insensitivity" been taken into consideration?
Sorry @songkeys, this issue must be opened for feedback in the feature preview and I closed it by accident, I think it will be better (for tracking) if once the release is out a new ticket is created with the case insensitivity in JSON filtering as a feature (it is easier for us to plan and track instead of having just a huge list of comments in a single ticket). Would that work for you?
Activity
matthewmueller commentedon May 18, 2021
For Postgres users: you should always use
path: string[]syntax. Right now we supportpath: string, but this will be disabled in the future to avoid the expectation that Postgres supports dot notation.Postgres doesn't support:
Instead it supports:
Here's an issue: #7136
For MySQL Users: MySQL does support dot notation:
So the string support will remain for MySQL.
Why? For maximum query flexibility, we pass the query paths directly into the database engines. The tradeoff is that the syntaxes are different.
andrewtran1995 commentedon Jun 1, 2021
Loving this feature so far! ❤️ The Prisma client documentation specifies that filtering on an object key inside of an array is only currently supported for the MySQL database connector.
Are there plans to expand this to other connectors as well, particularly PostgreSQL?
Pehesi97 commentedon Jun 1, 2021
This feature is missing case insensitivity support (at least for PostgreSQL, since I used to specify the
modefield to enable it for other field types)wyozi commentedon Jun 2, 2021
Great feature. Supporting JSON object containment check (
@>in Postgres) would allow me to stop relying on custom SQL for search query filtering. My usecase is querying rows where metadata (a shallow JSONB object with arbitrary keys and non-object values) contains specific subset of key-value pairs.janpio commentedon Jun 4, 2021
(Make sure there is an issue for this @wyozi - sounds like a good feature request)
[-]Preview feature feedback: Filtering JSON fields[/-][+]Preview feature feedback: Filtering JSON fields (`filterJson`)[/+]tre-dev commentedon Jun 15, 2021
Similar to @andrewtran1995, it would be great if I'd be able to filter JSON fields within a JSON[] using PostgreSQL.
filterJson is not in preview anymore (#2958)
songkeys commentedon Jun 15, 2022
Hi. I saw this issue was closed because filterJson is not in preview anymore. But has the feature request "case insensitivity" been taken into consideration?
cprieto commentedon Jun 15, 2022
Sorry @songkeys, this issue must be opened for feedback in the feature preview and I closed it by accident, I think it will be better (for tracking) if once the release is out a new ticket is created with the case insensitivity in JSON filtering as a feature (it is easier for us to plan and track instead of having just a huge list of comments in a single ticket). Would that work for you?
songkeys commentedon Jun 15, 2022
@cprieto Yes! Definitely sounds great. Thank you so much for the work. 👍🏻
semurgx commentedon Jul 1, 2022
It would be great, if Prisma would support Postgres's @> operator for JSON filtering.
muhammad-Osman commentedon Sep 5, 2022
i want to filter JSON on the base of label but once i give path under where condition it is giving me error
ajhollowayvrm commentedon Nov 2, 2022
Another bump on this for support Postgres JSON filtering and even other JSONB operators like JSONB_Insert.
rohanrajpal commentedon Nov 25, 2022
I was also figuring out a way to do this, were you able to figure it out or is it yet to be implemented?
[-]Preview feature feedback: Filtering JSON fields (`filterJson`)[/-][+]Preview feature feedback: Filtering `Json` fields (`filterJson`)[/+]janpio commentedon Jun 12, 2023
Filtering on a
Jsonfield has been GA for a while now since 4.0.0, Jun 28, 2022: https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filter-on-a-json-fieldIf you still have some cases that are not covered, please open a new issue. Thank you.