I have 4 separate array of objects, is there a way to join all of them into one big object based on the keys inside an object.
Here is an example OUTPUT: what I want to achieve.
[
{
"bugId": "",
"testerId": "",
"firstName": "",
"lastName": "",
"country": "",
"deviceId":"",
"description":""
}
]
Object of testers(It's more than 500)
[
{
"testerId":"1",
"firstName":"John",
"lastName":"Doe",
"country":"US",
}
]
Object for bugId (This should be the main object from where we will be able to get the output)
As deviceId is connected to description and testerId is connected to firstName, lastName and Country.
[
{
"bugId":"1",
"deviceId":"1",
"testerId":"1"
}
]
Object for tester_devices, one tester is provided 4 devices
[
{
"testerId":"1",
"deviceId":"1"
},
{
"testerId":"1",
"deviceId":"2"
},
{
"testerId":"1",
"deviceId":"3"
},
{
"testerId":"1",
"deviceId":"10"
}
]
Object of devices
[
{
"deviceId":"1",
"description":"iPhone 4"
}
]
I searched for Lodash Library, but here it's mentioned that for key with same name it's not possible to merge. What approach should I take?