如何从 mule 4 中的 salesforce 输出负载中删除字段名 "type"

How to remove fieldname "type" from salesforce output payload in mule 4

我正在使用 Salesforce "Query" 连接来获取 Mule 4 中的数据。但是,输出负载显示了一个名为类型的附加字段(显示 ObjectName)。有什么办法可以避免fetching/displaying这个字段吗?

传递给 Salesforce 的输入查询:"Select AccountNumber,Name,Id from Account"

输出:如您所见,我不想显示 "type"。

 [
  {
    "Id": "0012x0000054TjZAAU",
    **"type": "Account"**,
    "AccountNumber": "CD355120-B",
    "Name": "United Oil & Gas, Singapore"
  },
  {
    "Id": "0012x0000054TjUAAU",
    **"type": "Account"**,
    "AccountNumber": "CD439877",
    "Name": "Grand Hotels & Resorts Ltd"
  }
]

预期输出:输出中没有 "Type"。

 [
  {
    "Id": "0012x0000054TjZAAU",
    "AccountNumber": "CD355120-B",
    "Name": "United Oil & Gas, Singapore"
  },
  {
    "Id": "0012x0000054TjUAAU",
    "AccountNumber": "CD439877",
    "Name": "Grand Hotels & Resorts Ltd"
  }
]

快速解决方案:

映射每个项目并删除字段

%dw 2.0
output application/json
---
payload map $ - "type"

输出:

[
  {
    "Id": "0012x0000054TjZAAU",
    "AccountNumber": "CD355120-B",
    "Name": "United Oil & Gas, Singapore"
  },
  {
    "Id": "0012x0000054TjUAAU",
    "AccountNumber": "CD439877",
    "Name": "Grand Hotels & Resorts Ltd"
  }
]