Closed VictorShima closed 8 years ago
You should use 'foo[?(@.baz==1)]' to find [{'baz': 1}] from {'foo': [{'baz': 1}, {'baz': 2}]}
Or the data must be {'foo': [[{'baz': 1}, {'baz': 2}]]} (notes the double list) to 'foo[*][?(@.baz==1)]' to find [{'baz': 1}]
Anyways the code shouldn't raise an exception but just return an empty list. I have fixed that here:
https://github.com/sileht/python-jsonpath-rw-ext/commit/da3e74d4ffd5ca11faad6b0a3c76356a51e2cf28
Hello,
I just found out about your package and tried to test this code:
But I receive a KeyError. Could you check this out?
PS: thank you a lot for having the initiative to develop these jsonpath extensions =)