如何添加整个 json 作为带有震动的对象

how to add whole json as object with jolt

这是我的输入json

{
 "Name": "Back-test job",
 "market": "2",
 "TimeZone": "257",
 "company": "1"
}

我想将整个 json 添加为一个对象,如下所示:

{
 "Name": "Back-test job",
 "market": "2",
 "TimeZone": "257",
 "company": "1",

 "wholeJson":{
   "Name": "Back-test job",
   "market": "2",
   "TimeZone": "257",
   "company": "1"}
}

你对规格有什么想法吗?

只需通过使用 &1 调用基数 json 值两次,它指的是向上一级具有嵌套结构 "*": {...}shift 操作的规范中,其中一个在前面加上键 wholeJson 并且还应用 sort 规范来防止无序结果如

[
  {
    "operation": "shift",
    "spec": {
      "*": {
        "@": "&1",
        "@(1,&)": "wholeJson.&1"
      }
    }
  },
  {
    "operation": "sort",
    "spec": {
      "*": ""
    }
  }
]