Here is my json:
{ 'test': [ { "id": "1", "description": "Test 1" }, { "id": "2", "description": "Test 2" } ] }
I am trying to get the value for id , where description is "Test 1".
I found the following example on a JsonPath page:
$..book[?(@.price<10)]
When trying to parse the following jsonxpath expression:
parse('$..test[?(@.description="Test 1")].id')
I get the following error:
jsonpath_rw.lexer.JsonPathLexerError: Error on line 1, col 7: Unexpected character: ?
What am I doing wrong? Alternatively, is there a better way to do this?
source share