【发布时间】:2018-02-13 14:49:23
【问题描述】:
输入:-
[
{
"appName": "helloworld-1"
},
{
"appName": "helloworld-2"
}
]
预期输出
{
"appList": [ "helloworld-1" , "helloworld-2" ]
}
谁能指导我为此编写数据编织脚本?
【问题讨论】:
标签: mule dataweave mule-el mule-esb
输入:-
[
{
"appName": "helloworld-1"
},
{
"appName": "helloworld-2"
}
]
预期输出
{
"appList": [ "helloworld-1" , "helloworld-2" ]
}
谁能指导我为此编写数据编织脚本?
【问题讨论】:
标签: mule dataweave mule-el mule-esb
根据DataWeave Documentation,您可以应用多值选择器。多值选择器返回一个数组,其中包含键与表达式匹配的所有值。
%dw 1.0
%output application/json
---
{
appList : payload.*appName
}
【讨论】: