jmespath.site
jmespath.site copied to clipboard
How to find all by key?
Could you please help me how to find all condition nodes recursively?

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).
Probably this issue is relevant to https://github.com/jmespath/jmespath.py/issues/110
@sauron918 We want to propose this feature to JMESPath and will include this in the next iteration for JMESPath Community.