I have a Document, I want to use $pull or other good way to remove only device where "mobile_id": "opr_134" from devices list of address.
{
"user_id": "eamn",
"address": [{
"address_id": 32,
"city_name": "DP 1000"
"devices": [{
"mobile_id": "opr_123",
"created_at": 2132,
"device": "company"
},{
"mobile_id": "opr_134",
"created_at": 2134,
"device": "company2"
}]
}]
}
Please suggest an atomic way to remove this device.
question from:https://stackoverflow.com/questions/66050540/mongodb-remove-3rd-level-embedded-document