我一直在研究jolt变换找不到解决方案
我想有attributeType和attributeValue到每个attributeList和唯一的modelId,他们的关键名称应该在预期的输出区分大小写
输入
[
{
"MODELNUMBER": "A",
"ATTRIBUTETYPE": "Capability",
"ATTRIBUTEID": "0001",
"ATTRIBUTENAME": "hd",
"ATTRIBUTEVALUE": "false",
"RNK": 1,
"batchNumber": 1
},
{
"MODELNUMBER": "A",
"ATTRIBUTETYPE": "Capacity",
"ATTRIBUTEID": "0002",
"ATTRIBUTENAME": "capa",
"ATTRIBUTEVALUE": "100",
"RNK": 2,
"batchNumber": 1
},
{
"MODELNUMBER": "B",
"ATTRIBUTETYPE": "Capability",
"ATTRIBUTEID": "cat-0002",
"ATTRIBUTENAME": "capable",
"ATTRIBUTEVALUE": "true",
"RNK": 1,
"batchNumber": 1
}
]
预期输出
[
{
"inventoryModelId": "A",
"attributes": [
{
"attributeType": "Capability",
"attributeId": "0001",
"attributeName": "hd",
"attributeValue": "false",
"rnk": 1,
"batchNumber": 1
},
{
"attributeType": "Capacity",
"attributeId": "0002",
"attributeName": "capa",
"attributeValue": "100",
"rnk": 2,
"batchNumber": 1
}
]
},
{
"inventoryModelId": "B",
"attributes": [
{
"attributeType": "Capability",
"attributeId": "cat-0002",
"attributeName": "capable",
"attributeValue": "true",
"rnk": 1,
"batchNumber": 1
}
]
}
]
1条答案
按热度按时间y53ybaqx1#
您可以使用以下转换
网站http://jolt-demo.appspot.com/上的*demo为: