如何在 mulesoft ftp 创建步骤中从有效负载中排除列? (有效载荷是一个对象数组)

How to exclude a column from payload in mulesoft ftp create step ? (payload is an array of object)

这里是 FTP 创建代码:

%dw 2.0
output application/csv separator='|',
header = false
---
payload distinctBy $.integrationid orderBy $.integrationidl
- "integrationid" - "integrationidl"

在上面的代码中,我想使用 integrationid 和 integrationdl 列进行排序。但我不希望将有效负载中的这些列打印在 CSV 文件中。我根据 mulesoft 文档尝试了上面的代码,但它不起作用。很可能是因为它是一个数组。您能否帮助实现这一目标?

orderBy() 函数中的

Return 是一个数组。应用于对象和字符串的 - 运算符按键名从对象中删除键对。您不能将它应用于数组。这意味着您需要映射数组的每个元素并从每个元素中删除键。

%dw 2.0
output application/csv separator='|', header=false
---
payload 
    distinctBy $.integrationid
    orderBy $.integrationidl
    map $ - "integrationid" - "integrationidl"