Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple filtering for JSON #2345

Closed
janpio opened this issue Apr 30, 2020 · 6 comments
Closed

Simple filtering for JSON #2345

janpio opened this issue Apr 30, 2020 · 6 comments
Assignees
Labels
kind/feature A request for a new feature. tech/engines Issue for tech Engines. topic: client types Types in Prisma Client topic: native database types
Milestone

Comments

@janpio
Copy link
Member

janpio commented Apr 30, 2020

Follow up to #186

@janpio janpio added this to the Beta 5 milestone Apr 30, 2020
@janpio janpio added kind/feature A request for a new feature. tech/engines Issue for tech Engines. topic: client types Types in Prisma Client topic: native database types labels Apr 30, 2020
@tomhoule
Copy link
Contributor

We are working on implementing filtering (equality and non equality) on JSON fields in Postgres and MySQL (5.7 and 8). As far as I am aware, we don't have consensus on the implementation yet but we have multiple ways to implement it. One PR in this direction: prisma/prisma-engines#725

@janpio janpio changed the title Filtering JSON Simple filtering for JSON May 5, 2020
@tomhoule
Copy link
Contributor

tomhoule commented May 5, 2020

To clarify what we are currently looking into: this is only equals and not equals comparisons, so you would only be able to filter Json fields by comparing with an identical JSON value.

@janpio janpio modified the milestones: Beta 5, Beta 6 May 12, 2020
@radicand
Copy link

@tomhoule - so that I understand, if the DB has a row with a JSON field value of {"field":1, "anotherfield":2}, is this tracking just checking if the field is exactly that, or would something like checking if field1=1 be covered / match the row?

@tomhoule
Copy link
Contributor

For the first version no, we would only be comparing against the whole JSON value. We definitely want to enable more operations like comparing specific paths in JSON objects, like your example, but that will come later.

@tomhoule
Copy link
Contributor

I created an issue for more advanced JSON filtering: #2444

@do4gr
Copy link
Member

do4gr commented May 20, 2020

Closing this since simple equality filtering for the complete Json is now implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A request for a new feature. tech/engines Issue for tech Engines. topic: client types Types in Prisma Client topic: native database types
Projects
None yet
Development

No branches or pull requests

5 participants