我有一个JSON对象,格式如下:
{
"$type": "api.something, api.somethingElse",
"fromApi": {
"$type": "api.something, api.somethingElse",
"Id": "d1537a72-2e46-29c0-b119-2bac07857ka9",
"ItemId": "d1537a72-2e46-29c0-b119-2bac07869t8",
"Amount": 50,
"Increased": 10,
"Type": "increasment",
"SourceData": "{\"isIncreasment\":true,\"ItemId\":\"d1258672-3592-29c0-b119-2bac07857ka9\",\"testID\":105,\"ListId\":18576}",
"Date": "2023-06-12T13:47:57.66"
}
}
我希望通过JOLT转换将其转换为扁平格式,如下所示:
{
"type" : "api.something, api.somethingElse",
"Id" : "d1537a72-2e46-29c0-b119-2bac07857ka9",
"ItemId" : "a1537a72-2e46-29c0-b119-2bac07869t8",
"Amount" : 50,
"Increased" : 10,
"Type" : "increasment",
"isIncreasment" : "true",
"ItemId" : "d1258672-3592-29c0-b119-2bac07857ka9",
"testID" : 105,
"ListId" : 18576,
"Date": "2023-06-15T13:47:57.66"
}
这是可能的吗?如何做到?
1条答案
按热度按时间2wnc66cl1#
没有直接的替换函数,但可以通过在modify转换中使用连续的***split***和***join***函数来模拟,例如