我正在尝试应用jsonPath表达式:
"$.concat($.[?(@.channel=='one' &&
@.stream=='test')].air.track.author," - ",$.[?(@.channel=='one' &&
@.stream=='test')].air.track.title)"
至JSON:
[
{
"channel": "one",
"stream": "test",
"air": {
"track": {
"author": "Jack",
"title": "book1"
}
}
},
{
"channel": "one",
"stream": "prod",
"air": {
"track": {
"author": "Alex",
"title": "book2"
}
}
}
]
并收到错误消息:
* “无法分析从位置2开始的令牌。预期为?,',0-9,”
但是当我尝试:
"$.concat($.[0].air.track.author," - ",$.[0].air.track.title)"
结果是:“杰克-book1”
为什么使用过滤器调用$ .concat时会产生错误?