这是我的json:
{
'test': [
{ "id": "1", "description": "Test 1" },
{ "id": "2", "description": "Test 2" }
]
}
我试图得到id的值,其中描述是“测试1”。
我在JsonPath页面上找到了以下示例:
$..book[?(@.price<10)]
尝试分析以下jsonxpath表达式时:
parse('$..test[?(@.description="Test 1")].id')
我得到以下错误:
jsonpath_rw.lexer.JsonPathLexerError: Error on line 1, col 7: Unexpected character: ?
我做错什么了?或者,有没有更好的方法来做到这一点?
目前没有回答
相关问题 更多 >
编程相关推荐