Should filters pushed to the bottom of the query work? #89
Unanswered
NiklasRosenstein
asked this question in
Q&A
Replies: 1 comment
-
I believe this behaviour to be correct, according to RFC 9535, albeit not immediately intuitive. If we apply [
{
"type": "A"
},
{
"type": "B"
},
{
"type": "C"
}
] If we then apply the filter, Changing the filter to import jsonpath
data = [
{"payload": {"type": "A"}},
{"payload": {"type": "B"}},
{"payload": {"type": "C"}},
]
print(jsonpath.findall('$[*].payload[?(@ == "B")]', data)) # ['B'] |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I'm not entirely sure if this is supposed to work (though I think it would be intuitive and ergonomic if it would):
This gives you an empty list, when instead I would expect it to be equivalent to the result of this (working) version:
Beta Was this translation helpful? Give feedback.
All reactions