I need to merge two arrays of different structures to one based on a field value matching to a field of type array.
Here is the example of first array
[{
"id": "1",
"name" : "one"
},{
"id": "2",
"name" : "two"
},{
"id": "3",
"name" : "three"
}]
And the example of the second array
[{ num: [ '1', '5', '7' ], alph: 'AAA' },
{ num: [ '0', '2' ], alph: 'BBB' },
{ num: [ '-1', '3', '6' ], alph: 'CCC' }]
Expecting the output like
[{
"id": "1",
"name": "one",
"alph": "AAA"
}, {
"id": "2",
"name": "two",
"alph": "BBB"
}, {
"id": "3",
"name": "three",
"alph": "CCC"
}]