I currently have docs of type email_campaign , for speed i have an error in the doc’s which lists all email addresses this campaign went too which looks something like this below. how can i look for a match in an array of an array and then updated the document that contains the match in array.
So for example how to i find any doc under emails which has an "a****@wdc.com in its email array and then set the the key of bounce = true. I am trying to use N1QL to avoid multiple network roundtrips as i otherwise have to go use doc or subdoc to get emails array then go thru it to find match and then upsert the array again.
{
"_type": "email_campaign",
"status": "Active",
"start_date": "04/17/2020",
"end_date": "",
"template_id": "template::0a2decdd-3acd-4661-9721-1a9ec0d039e6",
"summary": "Reflections Update",
"metrics": {
"first_email_sent": "",
"last_email_send": "2020-04-17T22:11:52.317Z",
"nbr_of_emails": 185,
"nbr_of_bounces": 1,
"nbr_of_email_opened": 0,
"nbr_of_attachments_opened": 0,
"nbr_of_unique_email_opened": 0,
"nbr_of_unique_attachments_opened": 0
},
"tags": [],
"librarys": [],
"history": {
"created_on": "04/17/2020 13:24:33",
"created_by": "1233",
"updated_on": "",
"updated_by": ""
},
"emails": [
{
"email": [
"a****@wdc.com"
],
"track_request": "track_request::9189a59f-55e4-4cf2-a692-4e9a80fd3125",
"tracking_nbr": "4b6hCNt-6"
},
{
"email": [
"m******@alteryx.com"
],
"track_request": "track_request::7832472e-2eae-4bbe-83a7-fd928f7acd9c",
"tracking_nbr": "s-Z4t9fwJ6"
},]
}