Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to find all by key? #62

Open
sauron918 opened this issue Mar 21, 2019 · 2 comments
Open

How to find all by key? #62

sauron918 opened this issue Mar 21, 2019 · 2 comments

Comments

@sauron918
Copy link

sauron918 commented Mar 21, 2019

Could you please help me how to find all condition nodes recursively?

image

JSON example:

{
  "WHERE": {
    "AND": [
      {
        "condition": {
          "AND": [
            {
              "condition": {
                "name": "cond1"
              }
            },
            {
              "condition": {
                "name": "cond2"
              }
            }
          ],
          "name": "cond-group"
        }
      },
      {
        "condition": {
          "name": "cond3"
        }
      },
      {
        "condition": {
          "name": "cond4"
        }
      }
    ]
  }
}

I would like to find all conditions no matter where it is. Probably it should looks like *[?condition] or values(*)[?condition](non-rooted expressions).

@sauron918
Copy link
Author

Probably this issue is relevant to jmespath/jmespath.py#110

@springcomp
Copy link
Contributor

@sauron918 We want to propose this feature to JMESPath and will include this in the next iteration for JMESPath Community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants