I have the following mongoose schema:
user = {
\"userId\" : \"myId\",
\"connections\":
[{
\"dateConnectedUnix\": 1334567891,
\"is
I have a document like
I have to delete address from address array
After searching lots on internet I found the solution
Customer.findOneAndUpdate(query, {$pull: {address: addressId}}, function(err, data){
if(err) {
return res.status(500).json({'error' : 'error in deleting address'});
}
res.json(data);
});