gpt4 book ai didi

mule - 数据编织函数

转载 作者:行者123 更新时间:2023-12-05 08:55:33 24 4
gpt4 key购买 nike

这是我的 JSON 请求,我想在 DataWeave 转换中从我的 JSON 负载中删除 dcsId 字段。

我该怎么做?

{
"status": "ok",
"statusCode": "11011",
"statusDescription": "Service: Get Profile ; Market: US ; Locale:en-US ; SourceId:DCS; ApiUid: 644e1dd7-2a7f-18fb-b8ed-ed78c3f92c2b; Description: The get profile call was successful.",
"details": {
"dcsId": "rfggrg",
"marketCode": "US",
"languageCode": "en",
"profile": {
"base": {
"username": "abc",
"firstName": "xc",
"middleName": "test",
"lastName": "123",
"shortName": "xc",
"displayName": "D",
"suffix": "T",
"prefix": "E"
}
}
}
}

最佳答案

为了避免payload中其他字段的映射,你可以试试这个——

%dw 1.0
%output application/json
---
(payload - 'details') ++ (payload.details - 'dcsId')

它首先获取 payload 中除细节之外的所有内容,然后通过排除 dcsId 添加细节。

喂!

关于mule - 数据编织函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45567311/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com