Here is an array I have:
response=[
{
"mId": "4a993417-3dae-4a85-bb2e-c535d7fda6d7",
"title": "test2",
"score": "4",
"id": "91ce873f-6e58-4c30-86d4-4eb7f200640e"
}
]
[
{
"mId": "7896548-3dae-4a85-bb2e-c855d7fda6d7",
"title": "discussion",
"score": "18",
"id": "91ce873f-6e58-4c30-86d4-4eb7f200640e"
}
]
[
{
"mId": "20d78952-3dae-4a85-bb2e-c535d7fda6d7",
"title": "test",
"score": "1",
"id": "7777777f-6e58-4c30-86d4-4eb7f200640e"
}
]
Next, I have this array:
mixture=[{"id":"4a993417-3dae-4a85-bb2e-c535d7fda6d7","name":"flour","description":"10g sold"}]
[{"id":"20d78952-3dae-4a85-bb2e-c535d7fda6d7","name":"teabag","description":"stock arriving"}]
I'm trying to match the mId from the response array with the corresponding array in mixture to find the name. Here's how the new array should look:
newArray=[{
"name":"flour"
"mId": "4a993417-3dae-4a85-bb2e-c535d7fda6d7",
"title": "test2",
"score": "4",
"id": "91ce873f-6e58-4c30-86d4-4eb7f200640e"
}]
[{ "name":"flour"
"mId": "4a993417-3dae-4a85-bb2e-c535d7fda6d7",
"title": "discussion",
"score": "18",
"id": "91ce873f-6e58-4c30-86d4-4eb7f200640e"
}]
[{ "name":"teabag"
"mId": "7896548-3dae-4a85-bb2e-c855d7fda6d7",
"title": "test",
"score": "1",
"id": "7777777f-6e58-4c30-86d4-4eb7f200640e"
}]