# Update MongoDB document with a child record

**URL:** <https://discourse.nodered.org/t/update-mongodb-document-with-a-child-record/7910>\
**Category:** General\
**Created:** [13 February 2019 05:46 UTC](https://discourse.nodered.org/t/update-mongodb-document-with-a-child-record/7910 "2019-02-13T05:46:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pphillips](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@pphillips](https://discourse.nodered.org/u/pphillips)\
**Post date:** [13 February 2019 05:46 UTC](https://discourse.nodered.org/t/update-mongodb-document-with-a-child-record/7910/1 "2019-02-13T05:46:42Z")

</div>

Hi, I am pretty new to Node-Red. I have a Mongodb with an existing record, "{  
"\_id" : ObjectId("5c6227be3579f60c5431b66b"),  
"Title" : "Mr",  
"Instance" : "HQ",  
"FirstName" : "ppp",  
"LastName" : "Phillips",  
"Position" : "BF",  
"EmailAddress" : "contact@paulphillips.guru"  
}"

I have a workflow that expects a HTTP Post with the following:"  
"\_id":"5c6227be3579f60c5431b66b",  
"Instance": "HQ",  
"PPE":[  
{  
"Code": "PPE",  
"Status": "New",  
"Title": "Trousers",  
"Type": "STD",  
"Size": "10111116",  
"Qty": 1,  
"LostDamage": {  
"Reason": "asdaD",  
"Location": "Station",  
"Damage": "Damged"  
}  
},  
{  
"Code": "PPEOPP",  
"Status": "New",  
"Title": "TrousASDASDASDers",  
"Type": "STD",  
"Size": "10111116",  
"Qty": 1,  
"LostDamage": {  
"Reason": "asdaD",  
"Location": "Station",  
"Damage": "Damged"  
}  
}]  
}  
"  
The "\_id" is the parent record which I want to append the second child document too, so it should look something like this:"{  
"\_id" : ObjectId("5c6227be3579f60c5431b66b"),  
"Title" : "Mr",  
"Instance" : "HQ",  
"FirstName" : "ppp",  
"LastName" : "Phillips",  
"Position" : "BF",  
"EmailAddress" : "contact@paulphillips.guru",  
"PPE" : [  
{  
"Code" : "PPE",  
"Status" : "New",  
"Title" : "Trousers",  
"Type" : "STD",  
"Size" : "10111116",  
"Qty" : 1,  
"LostDamage" : {  
"Reason" : "asdaD",  
"Location" : "Station",  
"Damage" : "Damged"  
}  
},  
{  
"Code" : "PPEOPP",  
"Status" : "New",  
"Title" : "TrousASDASDASDers",  
"Type" : "STD",  
"Size" : "10111116",  
"Qty" : 1,  
"LostDamage" : {  
"Reason" : "asdaD",  
"Location" : "Station",  
"Damage" : "Damged"  
}  
}  
]  
}"

Any ideas?
