2017-10-18 2 views
0

JSONペイロードを目的のドキュメントに変換する際に問題が発生しています。私は入力を以下しているJOLTの仕様は、次の入力で希望の結果を達成するためにどのように見えますか?

{ 
    "events": [ 
    { 
     "recipientId": "r0001" 
    }, 
    { 
     "recipientId": "r0002" 
    } 
    ], 
    "networkResponseTime": 1234 
} 

所望の出力:

{ 
    "events": [ 
    { 
     "recipientIds": "r0001", 
     "networkResponseTime": 1234" 
    }, 
    { 
     "recipientIds": "r0002", 
     "networkResponseTime": 1234" 
    } 
    ] 
} 

をどのようにJOLTの仕様は、この例のようになりますか?

[{ 
    "operation": "shift", 
    "spec": { 
     "events": { 
     "*": { 
      "recipientId": "events[&1].recipientIds" 
     } 
     } 
    } 
}] 

答えて

1

スペック

[{ 
    "operation": "shift", 
    "spec": { 
    "events": { 
     "*": { 
     "recipientId": "events[&1].recipientIds", 
     // 
     // go back up to the root of the tree, and then 
     // come back down the key "networkResponseTime", and 
     // send it's value to "events[&1].networkResponseTime" 
     "@(2,networkResponseTime)": "events[&1].networkResponseTime" 
     } 
    } 
    } 
}] 

は、これまでのところ私はこのようななめらかを持っています

関連する問題