I have a Json Doc which i get from my back end which looks like the one below. It has an emails Array which the doc under it has and email array. I need to get the index the email array is part of which has a match for an email address so i can update the doc. i used lodash before to search for a key in a array of docs before with _.find and _.indexOf but not sure how this would work in an Array of Array case.
{
"_type": "email_campaign",
"status": "Active",
"start_date": "04/17/2020",
"template_id": "template::0a2decdd-3acd-4661-9721-1a9ec0d039e6",
"summary": "Update",
"metrics": {
"first_email_sent": "",
"last_email_send": "2020-04-17T22:11:52.317Z",
"nbr_of_emails": 185,
"nbr_of_bounces": 1,
},
"history": {
"created_on": "04/17/2020 13:24:33",
},
"emails": [
{
"email": [
"[email protected]"
],
"track_request": "track_request::da07bd4b-b03e-4ecc-9d90-32e85cdb5b3a",
"tracking_nbr": "MD1dpjR6d"
},
{
"email": [
"[email protected]",
"[email protected]",
],
"track_request": "track_request::6f64cee1-d38e-4d68-94a2-c3c7d1287984",
"tracking_nbr": "YM1sMRX3nl"
},
{
"email": [
"[email protected]"
],
"track_request": "track_request::92606d4f-f9e6-457f-9156-167eb068f05b",
"tracking_nbr": "gj6dwIyHdE"
},
],
"_id": "3ed76589-4063-49f6-a21e-9ca16981d102"
}