JsonPath max()发布空数组

时间:2019-08-16 13:54:59

标签: json jsonpath

我正在尝试使用JsonPath为下面的json字符串找到max(),但它会引发错误Aggregation function attempted to calculate value using empty array。请知道什么是正确的JsonPath以获得最大值。

[
    {"question":"pattern1","time":1},
    {"question":"pattern2","time":5}, 
    {"question":"pattern2","time":4}
]

$..time -- returns [1,5,4]
$..time.max() -- throws an error

0 个答案:

没有答案