As far as I know, AND / OR is not yet supported. But you can relate relatively closely to this array [,]. But even that made me think when I tested it. There is strange behavior. I took an example JSON string from the Jayway JsonPath Evaluator and put it in the JsonPath Expression Tester (because it didn't work with Jayway when I tried).
So, the JSON I tested with the curiousconcept version:
{ "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 }, { "category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.99 }, { "category": "fiction", "author": "Herman Melville", "title": "Moby Dick", "isbn": "0-553-21311-3", "price": 8.99 }, { "category": "fiction", "author": "JRR Tolkien", "title": "The Lord of the Rings", "isbn": "0-395-19395-8", "price": 22.99 } ], "bicycle": { "color": "red", "price": 19.95 } }, "expensive": 10 }
And the expression:
$..book[?(@.price==8.99),?(@.category=='fiction')]
that leads to:
[ { "category":"fiction", "author":"Herman Melville", "title":"Moby Dick", "isbn":"0-553-21311-3", "price":8.99 } ]
that seems perfect. (take the price 8.99 And the category is "fiction" ... perfect!)
BUT : change it to:
$..book[?(@.category=='fiction'),?(@.price==8.99)]
then output:
[ ]
It seems to me that [,] is not well implemented in the Jayway JsonPath Tester, as well as in the curiousconcept.com expression test.
But from what I know, they are working on a (real) implementation of AND and / or (issue27 here in Google code).
Hope this clears up at least something!