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

multiselect hash from nested dict without knowing key names doable?

Open halberom opened this issue 8 years ago • 0 comments

Hello

I'd really appreciate some help with the following structure

[ {"a": [ { "b": { "foo": { "c": { "bar": { "value": "123" } } } } } ] } ]

Where I know the names of all the keys except for foo and bar, and would like to return those key names when 'value'=='123'

i.e. something like

[].a[0].b.[@1].c.[@2].[?(value=="123")].{ firstkey: @1.key, secondkey: @2.key }

No idea if what I'm asking is possible.

halberom avatar Oct 30 '17 19:10 halberom