-
Notifications
You must be signed in to change notification settings - Fork 3
Description
What is
Trying to do something like:
$.store.book[? @.category == "reference" && @.author == "Nigel Rees" && @.price == 8.95]
will throw out the error:
Error parsing jsonpath: unexpected '&' at position 70
What works
Multiple ||
operators works, a single ||
with a &&
works, but two &&
back to back blows up. But, you can wrap the second condition in a parenthesis to get it to work:
$.store.book[? @.category == "reference" && (@.author == "Nigel Rees" && @.price == 8.95)]
If you need more &&
conditions, you would need to do something like this:
$.store.book[? @.category == "reference" && (@.author == "Nigel Rees" && (@.price == 8.95 && @.title == "Sayings of the Century")) ]
What do
I can't tell if this is intentional or not since the RFC doesn't really give much on the &&
operator. There also isn't a test for this in the compliance test suite.
I'm thinking of cracking open an issue on the compliance test suite to get feedback and add the test if it makes sense.
Would you be cool with me trying my hand at the PR if it turns out the test was missing?