Here's the situation.
I have four arrays like below that have the same length (per array) and matching "id" fields.
How can I merge elements using this matching "id" field?
array_1 = [
{
"id": "111",
"field_1" "some string variables here",
...
},
{
"id": "222",
"field_1" "some string variables here",
...
},
...
]
array_2 = [
{
"id": "111",
"field_2" "other string variables here",
...
},
{
"id": "222",
"field_2" "other string variables here",
...
},
...
]
...
Expected result:
result_array_after_merge = [
{
"id": "111",
"field_1" "some string variables here", <-- from array_1
"field_2" "other string variables here", <-- from array_2
...
},
{
"id": "222",
"field_1" "some string variables here", <-- from array_1
"field_2" "other string variables here", <-- from array_2
...
},
...
]