I have the following json :
{
"details":{
"car": "bmw",
"addresses":{
"ext-118-21-8-0-29":[
{
"version":4,
"addr":"89 Psr"
},
{
"version":6,
"addr":"56 apT"
}
]
}
}
}
The key ext-118-21-8-0-29 is dynamic it will change the next time and I don't know the exact value, that's why I need to use wildcard. I need to get the value of the key addr where version is 4.
I'm expectig as output 89 Psr
I tried the following using the function startswith().
jq '.detail.addresses | select(startswith("ext"))'
But it end with an error.
jq: error (at :0): startswith() requires string inputs