You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have below JSON, where I want to compare "categoryType" value with categories' object's "type" and pick up the matching object. Please find the details below,
And the output I am getting is as below, which is incorrect because @(3,categoryType) value is "A", so it should only pick up the "type" matching the value "A". If I replace "@(3,categoryType)" with "A", it will pick up only one object matching the type "A". Any idea how to resolve this issue?
{
"category" : [ {
"type" : "A",
"issue" : "1"
}, {
"type" : "B",
"issue" : "2"
}, {
"type" : "C",
"issue" : "3"
} ]
}
The text was updated successfully, but these errors were encountered:
I have below JSON, where I want to compare "categoryType" value with categories' object's "type" and pick up the matching object. Please find the details below,
Input
{
"categoryType": "A",
"categories": [
{
"type": "A",
"issue": "1"
},
{
"type": "B",
"issue": "2"
},
{
"type": "C",
"issue": "3"
}
]
}
Expected Output
{
"category" : {
"type" : "A",
"issue" : "1"
}
}
My JOLT Configuration
[
{
"operation": "shift",
"spec": {
"categories": {
"*": {
"type": {
"@(3,categoryType)": {
"@2": "category"
}
}
}
}
}
}
]
And the output I am getting is as below, which is incorrect because @(3,categoryType) value is "A", so it should only pick up the "type" matching the value "A". If I replace "@(3,categoryType)" with "A", it will pick up only one object matching the type "A". Any idea how to resolve this issue?
{
"category" : [ {
"type" : "A",
"issue" : "1"
}, {
"type" : "B",
"issue" : "2"
}, {
"type" : "C",
"issue" : "3"
} ]
}
The text was updated successfully, but these errors were encountered: