【发布时间】:2018-05-30 12:13:25
【问题描述】:
考虑这个文件:
{"x": [
{
"a": {
"b": [],
"c": 42
}
},
{
"a": {
"d": true
}
}
]}
但现在我需要像这样将所有bs(不需要存在!)向下移动一级:
{"x": [
{
"a": {
"e": {
"b": []
},
"c": 42
}
},
{
"a": {
"d": true
}
}
]}
我见过the example that does the opposite,但很遗憾我无法将其应用到我的案例中。
【问题讨论】:
-
输入文档是无效的JSON,更新你的问题
标签: json object transformation jq