Rename fields in nested arrays using JOLT transformation

前端 未结 1 1909
深忆病人
深忆病人 2021-01-07 06:53

I want to rename fields in an array nested in an another array using JOLT transformation library. 1. One field to rename is a top level field in an array 2. Two fields to r

1条回答
  •  别那么骄傲
    2021-01-07 07:37

    Spec

    [
      {
        "operation": "shift",
        "spec": {
          "country": "country",
          "state": {
            "*": { // state array index
              "stateName": "state[&1].stateName",
              "location":  "state[&1].location",
              "cities": {
                "*": { // city array index
                  "name": "state[&3].cities[&1].cityname",
                  "pop":  "state[&3].cities[&1].citypopualtion"
                }
              }
            }
          }
        }
      }
    ]
    

    0 讨论(0)
提交回复
热议问题