I'm getting a message from a system in json format and want to perform a transformation in order to get below message
Source message:
[
{
"OPERATING_COMPANY": "xx",
"STORE_CLOSING_TIME": "2019-01-03T22:00:00",
"BATCH_ID": 1812,
"STORENUMBER": 1197,
"PROCESS_STATUS": "P"
},
{
"OPERATING_COMPANY": "xx",
"STORE_CLOSING_TIME": "2019-01-04T18:00:00",
"BATCH_ID": 1812,
"STORENUMBER": 1197,
"PROCESS_STATUS": "P"
},
{
"OPERATING_COMPANY": "xx",
"STORE_CLOSING_TIME": "2019-01-03T22:00:00",
"BATCH_ID": 1314,
"STORENUMBER": 1198,
"PROCESS_STATUS": "P"
},
{
"OPERATING_COMPANY": "xx",
"STORE_CLOSING_TIME": "2019-01-04T18:00:00",
"BATCH_ID": 1314,
"STORENUMBER": 1198,
"PROCESS_STATUS": "P"
}]
Expected Output
[
{
"OPERATING_COMPANY": "xx",
"STORE_CLOSING_TIME": ["2019-01-03T22:00:00","2019-01-04T18:00:00"],
"BATCH_ID": 1812,
"STORENUMBER": 1197,
"PROCESS_STATUS": "P"
},
{
"OPERATING_COMPANY": "xx",
"STORE_CLOSING_TIME": ["2019-01-03T22:00:00","2019-01-04T18:00:00"],
"BATCH_ID": 1812,
"STORENUMBER": 1198,
"PROCESS_STATUS": "P"
}]
I'm new to dataweave and tried using map but not able to understand how to achieve result.