求解mongoose的批量删除
如题,目前已知用mongoose的单个删除:
// category
var schema = new Schema({
user_id: String,
name: String
});
// 删除
exports.deleteCate = function(req, res) {
categoryModel.remove({_id: req.body._id}, function(err) {
if(err) {
return res.json({err: err});
} else {
return res.json({msg: 'success'});
}
});
};