我想使用jolt转换来检查数据是否匹配。
输入:
{
"nodes": [
{
"id": "Type:APPLICATION_COMPONENT, id:206180",
"flowMapNodeType": "MAIN_DASHBOARD_NODE",
"name": "WebFrontEnd",
"viewPermission": true,
"agentUp": false
},
{
"id": "Type:APPLICATION_COMPONENT, id:206183",
"flowMapNodeType": "MAIN_DASHBOARD_NODE",
"name": "AccountManagement",
"viewPermission": true,
"agentUp": false
},
{
"id": "Type:APPLICATION_COMPONENT, id:206188",
"flowMapNodeType": "MAIN_DASHBOARD_NODE",
"name": "PerLoanServices",
"viewPermission": true,
"agentUp": false
},
{
"id": "Type:APPLICATION_COMPONENT, id:206182",
"flowMapNodeType": "MAIN_DASHBOARD_NODE",
"name": "PolicyServices",
"viewPermission": true,
"agentUp": false
},
{
"id": "Type:APPLICATION_COMPONENT, id:206184",
"flowMapNodeType": "MAIN_DASHBOARD_NODE",
"name": "BizLoanServices",
"viewPermission": true,
"agentUp": false
},
{
"id": "Type:APPLICATION_COMPONENT, id:206185",
"flowMapNodeType": "MAIN_DASHBOARD_NODE",
"name": "BalanceServices",
"viewPermission": true,
"agentUp": false
},
{
"id": "Type:APPLICATION_COMPONENT, id:206186",
"flowMapNodeType": "MAIN_DASHBOARD_NODE",
"name": "SessionTracking",
"viewPermission": true,
"agentUp": false
}
],
"sourceNode": "Type:APPLICATION_COMPONENT, id:206183",
"targetNode": "Type:APPLICATION_COMPONENT, id:206184"
}
字符串
如果sourceNode
与nodes
子阵列中的node.id
匹配,则将添加新字段sourceNodeName
,其是相同id
的node.name
字段。类似地,targetNode
与节点子阵列中的node.id
匹配,则将添加新字段targetNodeName
,其是相同id
的node.name
字段。
此输入的预期输出:
{
"sourceNodeName" : "AccountManagement",
"targetNodeName" : "BizLoanServices"
"sourceNode" : "Type:APPLICATION_COMPONENT, id:206183",
"targetNode" : "Type:APPLICATION_COMPONENT, id:206184"
}
型
1条答案
按热度按时间kokeuurv1#
您可以使用以下转换:
字符串
网站http://jolt-demo.appspot.com/上的 * 演示 * 是:
的数据