I need to merge two JSON files into one. The requirement is to replace values of keys existing in both files by values from second file. And add keys doesn't exist in first should be appended to the output JSON.
Is it possible to use jq
to perform this operation?
First JSON:
{
"foo": "bar",
"aaa": "aaa",
"count": 0
}
Second JSON:
{
"bbb": "bbb",
"count": 1
}
Expected output:
{
"foo": "bar",
"aaa": "aaa",
"count": 1,
"bbb": "bbb"
}