Skip to content

Should filters pushed to the bottom of the query work? #79

Description

@NiklasRosenstein

Hi! I'm not entirely sure if this is supposed to work (though I think it would be intuitive and ergonomic if it would):

data = [
    {"payload": {"type": "A"}},
    {"payload": {"type": "B"}},
    {"payload": {"type": "C"}},
]

print(jsonpath.findall('$[*].payload[?(@.type == "B")]', data))

This gives you an empty list, when instead I would expect it to be equivalent to the result of this (working) version:

print(jsonpath.findall('$[?(@payload.type == "B")].payload', data))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions