I got below array of object from response
[{
"pagination":
{
"count": 1
},
"products": [
{
"createdBy": "user1",
"status": 1,
}
]
},
{
"pagination": {
"count": 3
},
"products": [
{
"createdBy": "user2",
"status": 2,
},
{
"createdBy": "user3",
"status": 3,
}
]
}
}
]
I want to merge objects of array by keys - products and pagination. I want my final output to be like in below format
{
"products": [
{
"createdBy": "user1",
"status": 1,
},
{
"createdBy": "user2",
"status": 2,
},
{
"createdBy": "user3",
"status": 3,
}
]
}
Kindly help how to achieve this