Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
输入:
{"aa":["a1","a2"]} {"bb":["a1","b2"]}
想要的输出(不用担心可能重复的键):
{ "aa":["a1","a2"], "bb":["b1","b2"] }
非常感谢!
最简单的无疑是使用调用:
jq -s add
如果输入流非常大,最好使用归约,例如:
jq -n 'reduce inputs as $i ({}; . + $i)'