Jolt 转换以匹配多个键值
Jolt Transformation to match on multiple key values
我正在努力寻找正确的震动规范来在创建输出之前评估两个键的值。有什么想法吗?
输入:
{
"ticketInformation": {
"area": "001",
"site": "ABC",
"ticketType": "TC"
}
}
规格:
[
{
"operation": "shift",
"spec": {
"ticketInformation": {
"area": {
"001": {
"#Works": "OneMatch"
}
},
"ticketType": {
"TC": {
"#OnlyEvaluatingTicketType": "HowToEvalueValuesOfTwoKeys"
}
}
}
}
}
]
输出:
{
"OneMatch" : "Works",
"HowToEvalueValuesOfTwoKeys" : "OnlyEvaluatingTicketType"
}
期望的输出与实际输出相同,但前提是 area=001 AND troubleType=TC。
我想这就是您要找的规格
[
{
"operation": "shift",
"spec": {
"ticketInformation": {
"area": {
"001": {
"@(2,ticketType)": {
"TC": {
"#Yes": "BothMatching"
}
}
}
}
}
}
}
]
我正在努力寻找正确的震动规范来在创建输出之前评估两个键的值。有什么想法吗?
输入:
{
"ticketInformation": {
"area": "001",
"site": "ABC",
"ticketType": "TC"
}
}
规格:
[
{
"operation": "shift",
"spec": {
"ticketInformation": {
"area": {
"001": {
"#Works": "OneMatch"
}
},
"ticketType": {
"TC": {
"#OnlyEvaluatingTicketType": "HowToEvalueValuesOfTwoKeys"
}
}
}
}
}
]
输出:
{
"OneMatch" : "Works",
"HowToEvalueValuesOfTwoKeys" : "OnlyEvaluatingTicketType"
}
期望的输出与实际输出相同,但前提是 area=001 AND troubleType=TC。
我想这就是您要找的规格
[
{
"operation": "shift",
"spec": {
"ticketInformation": {
"area": {
"001": {
"@(2,ticketType)": {
"TC": {
"#Yes": "BothMatching"
}
}
}
}
}
}
}
]