I am doing something fundamentally wrong but just can't see what, could some kind person point out my fault with jq or JSON here?
I have the the following child objects contained within an array “entries”
{
"profile": {
"name": "TesterRun1",
"download": {
"entries": [{
"ENTRY_A": "testserver1_place_com",
"store": "A",
"type": "direct"
},
{
"ENTRY_B": "testserver2_anotherplace_com",
"store": "B",
"type": "bypass"
},
{
"ENTRY_B": "testserver2_anotherplace_com",
"store": "A",
"type": "bypass"
}
]
}
}
}
I wish to convert these to an array accessible by bash via the jq function “to_entries” using the below query but so far nothing!
jq 'to_entries|.[]|.profile.download.entries|select(.store=="A")|.[]'
You can see here that nothing is returned on JQ Play - enter link description here
Please help save my sanity, what am I doing wrong
to_entriesdoes not make things accessible to bash. Not sure where you got the idea that's what it does.