Here's my json:
{
'test': [
{ "id": "1", "description": "Test 1" },
{ "id": "2", "description": "Test 2" }
]
}
I'm trying to get the value for id where description is "Test 1".
I found the following example on the 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?