cat test.json | jq 'map(if ParameterKey == "Project" then . + {"ParameterValue" = "jess-project"} else . end )'
jq: error: syntax error, unexpected '=', expecting '}' (Unix shell quoting issues?) at <top-level>, line 1:
map(if ParameterKey == "Project" then . + {"ParameterValue" = "jess-project"} else . end )
jq: 1 compile error
答案 0 :(得分:1)
jq
中的对象构造使用类似于JavaScript Object Notation(JSON)的语法。
{"ParameterValue" = "jess-project"}
在JSON中无效。您的意思是{"ParameterValue": "jess-project"}
吗?