how to check record successfully delete in mongodb node js

Solutions on MaxInterview for how to check record successfully delete in mongodb node js by the best coders in the world

showing results for - "how to check record successfully delete in mongodb node js"
Giacomo
20 Jul 2018
1Model.remove({ _id: req.body.id }, function(err) {
2    if (!err) {
3            message.type = 'notification!';
4    }
5    else {
6            message.type = 'error';
7    }
8});
9