How can I add, or modify if the element already exists, an element for each object in an array using jq
?
For example going from:
[
{
"firstname": "Sophie",
"lastname": "Haydock"
},
{
"firstname": "Toussaint",
"lastname": "Louverture"
}
]
to
[
{
"firstname": "Sophie",
"lastname": "Haydock",
"common": "something"
},
{
"firstname": "Toussaint",
"lastname": "Louverture",
"common": "something"
}
]
This is different from the question marked as duplicate in that it adds an element to an object in an array rather than add an object to an array.