I have the following objects:
// exhibit a
{
"exported_modules": ["a", "b"]
}
// exhibit b
{
"name": "thing b"
}
They exist in separate files. I need to basically transform them such that they are output unified in the following state:
{
"exported_modules": ["a", "b"],
"modules": {
"a": {
"name": "thing b"
}
}
}
Essentially I need to insert the contents of exhibit b into .modules.a
. Is there a way to do this in jq? I'm on jq
1.3 unfortunately, which is provided by my distribution.
I have been trying what has been recommended here but I have not been able to merge into a specific location rather than just merge all keys.