I have a system that outputoutputs multiple types of JSON filefiles with data.
Is there any chance to implement abovethe three conditions below using JQ packagejq
? I am exploring the mapmap()
command, and the arg--arg
and argjson--argjson
command. But line options, but I am having a tough time.
First JSON of, where I do have an assetasset
object and I want to add following key value-value pair:
2nd JSON of, where I do notdon't have an assetasset
object, so I want to add the object and the following key value-value pair
Desired output:Desired output:
3rd JSON of, where I do have an assetasset
object, but I would like to change the key value-value pair of househouse
if it hasis set to falsefalse
and set colourcolour
to orangeorange
:
Desired output:Desired output: