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

support for JSON/SQL style filters? #84

Open
bdeboe opened this issue Aug 9, 2021 · 0 comments
Open

support for JSON/SQL style filters? #84

bdeboe opened this issue Aug 9, 2021 · 0 comments

Comments

@bdeboe
Copy link

bdeboe commented Aug 9, 2021

JSON/SQL implementations such as PostgreSQL and Oracle seem to use a slightly different style of filters than what is supported by this library:

select * from jsonb_path_query('{"a":[1,2,3,4,5]}', '$.a[*] ? (@ >= 2 && @ <= 4)') -- Postgres

select * from JSON_QUERY('...', '$.friends[3]?(@.addresses.city == "San Francisco")') -- Oracle

Whereas those JSONPath expressions would have to be rewritten to $.a[? (@ >= 2 && @ <= 4)] and $.friends[3, ?(@.addresses.city == "San Francisco")], respectively to work for this library. Has this request come up before? Anyone knows a library that follows this approach?

Note that the latter example combines an index with a filter as requested in #50, for which the "SQL notation" might actually be a helpful approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants