[{
"_id": "5fd6288a155cda5a10d067fa",
"contacts": [
{
"_id": "5fd6288a155cda5a10d067fb",
"id": "5fd35931ec23f76d387d8464",
"name": "dean"
},
{
"_id": "5fd6288a155cda5a10d067fc",
"id": "12",
"name": "john"
},
{
"_id": "5fd6288a155cda5a10d067fd",
"id": "1",
"name": "brad"
}
],
"messages": [],
"__v": 0
},
{
"_id": "5fd63ab97aac3826f8e64558",
"contacts": [
{
"_id": "5fd63ab97aac3826f8e64559",
"id": "5fd35931ec23f76d387d8464",
"name": "dean"
},
{
"_id": "5fd63ab97aac3826f8e6455a",
"id": "12",
"name": "brad"
}
],
"messages": [],
"__v": 0
}]
Quick overview: each object contains a different conversation data.
I want to extract the names out of each conversation and store them in a separate array.
for instance: [[dean, john, brad], [dean, brad]]