$.concat 函数不适用于 jsonPath 的 jayway 实现中的过滤器



我正在尝试应用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)"

结果是:"Jack-book1">

当使用filter调用$.concat时,为什么会产生错误?

https://jsonpath.herokuapp.com/

2.5.0版本中解决的问题:https://github.com/json-path/JsonPath/issues/620

最新更新