I have the following json:
{
"thermostats": [
{
"name": "Thermostat1",
"identifier": 111111111111
},
{
"name": "Thermostat2",
"identifier": 222222222222
}
]
}
I'd like to add the following {default: yes} to the one that I select.
{
"thermostats": [
{
"name": "Thermostat1",
"identifier": 111111111111,
"default": "yes"
},
{
"name": "Thermostat2",
"identifier": 222222222222
}
]
}
I have the following but haven't figured out how to add the record
q '.thermostats[] | select (.identifier == "1111111111")
I've tried . += {default: yes} | . += {default: yes} |= . + but I'm going off the wrong track.
Thanks