OK here is my sample scenario, i have Docs which store Leads, each lead can have more then 1 Person object and each person object can have 1 or more phone or email objects. So my thing is i want to be able to do the folowing after i created the initial lead is to update person or add new phone or email to given person. i dont want to use the index in array to upsert but use an id in my object.
here is a sample doc
{
“type”: “Lead”,
“person”: [
{
“id”: 1,
“first_name”: “Tom”,
“middle_name”: “M”,
“last_name”: “Miller”,
“title”: “Dr.”,
“suffix”: “II”,
“gender”: “m”,
“dob”: “07/12/1978”,
“email”: [
{
“id”: 1,
“email_address”: "tom@email.com",
“default”: “yes”
},
{
“id”: 2,
“email_address”: "tom@email.com"
}
],
“phone”: [
{
“id”: 1,
“country”: “+1”,
“phone_number”: 2135551212,
“ext”: “”,
“type”: “mobile”,
“sms”: “yes”,
“default”: “yes”
},
{
“id”: 2,
“country”: “+1”,
“phone_number”: 2135554444,
“ext”: 455,
“type”: “office”,
“sms”: “no”,
“default”: “yes”
}
]
}
],
“home_address”: {
“street_address”: “28812 Aloma Ave”,
“city”: “Laguna Niguel”,
“state”: “CA”,
“zip”: 92677,
“country”: “US”
},
“search_info”: {
“min_beds”: 3,
“min_bath”: 2.5,
“min_garage”: 2,
“garage_type”: “any”,
“pool”: “yes”,
“min_sqft”: 2500,
“max_sqft”: 3500,
“min_lot_size”: 10000,
“max_lot_size”: 15000,
“max_storey”: 1,
“notes”: “Wants a fixer upper”
}
}
my question is how would i access the path of dob for the person with id =1 or how would i access the email object for person id=1 and email id =2. I have not found any good info on that and wonder if this is even possible.