I have been working with JSON data structures and I am looking to filter it in order to create separate arrays based on specific keys.
Current JSON Data:
data: {
message: 'Customer Transaction',
errorCode: null,
data: [
{
fields: 'Expected number of transaction per quarter',
attributeValue: '1 to 25',
attributeValueCode:"7",
},
{
fields: 'Expected number of transaction per quarter',
attributeValue: '26 to 50',
attributeValueCode:"8",
},
...
],
},
Desired JSON Structure After Processing:
{"metaData":{
"Expected number of transaction per quarter": ['1 to 25','26 to 50', 'Greater than 50'],
...
}
}