【发布时间】:2021-02-02 15:17:13
【问题描述】:
我有一个带有单个索引的数组,该数组有一个 JSON 对象,其中包含三个不同的字符串数组,我必须根据每个索引将它们映射到一个单独的数组中。例如,每个数组中的所有第一个索引到一个单独的 JSON 对象等等......
是否可以在 Dataweave 转换中实现?
输入
[{
"id": [
"123",
"456",
"789"
],
"name": [
"Test Brand 1",
"Test Brand 2",
"Test Brand 3"
],
"address": [
"Via Roma 1",
"Via Milano 1",
"Via Napoli 1"
]
}]
期望的输出:
[
{
"Key1": "123",
"Key2": "Test Brand 1",
"Key3": "Via Roma 1"
},
{
"Key1": "456",
"Key2": "Test Brand 2",
"Key3": "Via Milano 1"
},
{
"Key1": "789",
"Key2": "Test Brand 3",
"Key3": "Via Napoli 1"
}
]
【问题讨论】:
标签: arrays json dataweave anypoint-studio mulesoft