Created 05-02-2023 09:48 AM
Hi,
This one was a little trickier from the first post, but it seems that there is nothing that you cant do with Jolt 🙂 . Please try the following spec:
[
{
// combine all resourceRelationshipCharacteristic under one group
// and assign each element under the group unique key depending on
// its index location starting from first array under resourceRelationship (&3) and
// and ending with nested array resourceRelationshipCharacteristic ($1) so
// each element will have unique name 00,01,10,11...
"operation": "shift",
"spec": {
"resource": {
"resourceRelationship": {
"*": {
"resourceRelationshipCharacteristic": {
"*": {
"@(6,header.action)": "&3&1.action",
"@(6,header.timeStamp)": "&3&1.timeStamp",
"@(2,relationDrniId)": "&3&1.relationDrniId",
"*": "&3&1.&"
}
}
}
}
}
}
},
{
// bucket each element (00,01,10,11) value into new Array records
"operation": "shift",
"spec": {
"*": "records.[#1]"
}
}
]
Hope that helps.
I wonder if there is better\cleaner way @araujo @cotopaul @steven-matison