You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to get the number of item with preferred==true
const result = JSONPath({ path: '$.contactMedium[?(@.preferred==true)].length', json: data })
Current behavior
got []
Desired behavior
got 2
Alternatives considered
currently, i can got the result expected by this way.
const result = JSONPath({ path: '$.contactMedium[?(@.preferred==true)]', json: data })
console.log(result)
const result2 = JSONPath({ path: '$.length', json: result })
console.log(result2)
The text was updated successfully, but these errors were encountered:
Motivation
I have a json like this:
I want to get the number of item with preferred==true
const result = JSONPath({ path: '$.contactMedium[?(@.preferred==true)].length', json: data })
Current behavior
got []
Desired behavior
got 2
Alternatives considered
currently, i can got the result expected by this way.
const result = JSONPath({ path: '$.contactMedium[?(@.preferred==true)]', json: data })
console.log(result)
const result2 = JSONPath({ path: '$.length', json: result })
console.log(result2)
The text was updated successfully, but these errors were encountered: