jsonpath
jsonpath copied to clipboard
Expression for filter path not working
obj = {"commands":[{"id":1,"value":false},{"id":2,"value":false},{"id":3},{"id":4,"value":true}]}
path = '$.commands[?(@.value)]' // filter expression to fetch objects which have 'value' field.
jsonpath.query(obj, path) // undefined
I feel boolean values break the filter expression. Any Idea guys?
I meet the same question >..T_T
I am having the same issue. I tested my expression on http://jsonpath.herokuapp.com/ and it worked fine there, but whenever I run it in my javascript it returns an empty list.
Version: 1.1.1