I have the following structure in my document:
{
"_id": ObjectId("5891a85bccaad513a844308f"),
"sites": [
{
"site": "site1",
"url": "site1.com",
"status": 1,
},
{
"site": "site2",
"url": "site2.com",
"status": 1,
},
{
"site": "site3",
"url": "site3.com",
"status": 1,
}
]
}
then I load all sites to UI. then I'll do some changes like following image and hit Update. I have deleted "site3".
then My structure should update like as follow. site3 status should update to 0
{
"_id": ObjectId("5891a85bccaad513a844308f"),
"sites": [
{
"site": "site1",
"url": "site1.com",
"status": 1,
},
{
"site": "site2",
"url": "site2.com",
"status": 1,
},
{
"site": "site3",
"url": "site3.com",
"status": 0,
}
]
}
How can I achieve this ?