Hi I want get legth of array after Filter with JsonPath.
Is it possible ?
My filter is $.issues.[?(@.severity == 'MAJOR')].length()
My Json is
{
"issues": [
{
"severity": "MAJOR"
},
{
"severity": "MINOR"
},
{
"severity": "MAJOR"
},
{
"severity": "MAJOR"
},
{
"severity": "MAJOR"
}
]
}
(array|false): Array holding either values or normalized path expressions matching the input path expression, which can be used for lazy evaluation.falsein case of no match. So there is nothing that returns the count of matches in the proposal itself. But maybe your language & framework supports something. Or you can just count the number of items returned afterwards.