簡體   English   中英

使用 jolt 基於位置進行數組轉換的 Json

[英]Json with array transformation based upon position using jolt

我是新來的震動。 你能告訴我如何使用 jolt 將下面的 json 消息轉換為基於位置的數組到下面的輸出 json 消息嗎?

輸入消息:

[
    ["20084541", "12020584", "Frohmann Dov", "2017", "2", "75", "T7", "DFZ", "CES", "", "", "0", "90", "2010"],
    ["20084541", "12020584", "Frohmann Dov", "2017", "3", "21", "T7", "DFZ", "CES", "", "", "0", "90", "2010"],
]

輸出消息:

[{
    "policyReference": "20084541",
    "insuredId": "12020584",
    "insuredName": "Frohmann Dov",
    "uwy": "2017",
    "subLOB": "2",
    "typeOfRisk": "75",
    "aircraftcountryCode": "T7",
    "aircraftId": "DFZ",
    "manufacturerId": "CES",
    "aircraftTypeCode": "",
    "aircraftSubTypeCode": "",
    "aircraftValueAmt": "0",
    "aircraftWorkNo": "90",
    "yearBuilt": "2010"
}, {
    "policyReference": "20084541",
    "insuredId": "12020584",
    "insuredName": "Frohmann Dov",
    "uwy": "2017",
    "subLOB": "2",
    "typeOfRisk": "75",
    "aircraftcountryCode": "T7",
    "aircraftId": "DFZ",
    "manufacturerId": "CES",
    "aircraftTypeCode": "",
    "aircraftSubTypeCode": "",
    "aircraftValueAmt": "0",
    "aircraftWorkNo": "90",
    "yearBuilt": "2010"
}]

任何幫助表示贊賞。

規格

[
  {
    "operation": "shift",
    "spec": {
      "*": { // loop thru the outer array
        // each item of the outer array, is an array
        // match individual array indicies, and then send them to the 
        //  output with the nice name.
        "0": "[&1].policyReference",
        "1": "[&1].insuredId",
        "2": "[&1].insuredName" 
        // etc
      }
    }
  }
]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM