jmespath.site icon indicating copy to clipboard operation
jmespath.site copied to clipboard

How to find all by key?

Open sauron918 opened this issue 6 years ago • 2 comments

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 avatar Mar 21 '19 11:03 sauron918

Probably this issue is relevant to https://github.com/jmespath/jmespath.py/issues/110

sauron918 avatar Mar 21 '19 11:03 sauron918

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

springcomp avatar Jun 24 '23 07:06 springcomp