Closed rams3sh closed 5 years ago
The solution is to use values(@).
Reference link https://github.com/jmespath/jmespath.site/issues/24
So one of the possible solution for the above ask is
people.values(@)[?starts_with(First,`J`)].last
Would be nice if such examples of wildcard key based condition filters are added to jmespath tutorials. Most of the ones there currently focus on indexes with standard key structure.
Cheers
This was a big help! Thanks! Did not manage to find these wildcard examples anywhere else
I am working on a json with structure that looks like this
I am trying to get the the last values of those with first value starting with "J".
There are variable keys in between i.e a,b,c etc ..
I have tried it using jq and the query looks something like this
However , I am unable to achieve the same with jmespath. The closest that I could get logically based on my understanding from documentations available online was
However , it yields an empty value.