findOneAndRemove删除错误的用户

时间:2019-01-03 14:00:59

标签: node.js mongodb

router.delete('/user/:userId', (req ,res) => {   

    User.findOneAndRemove(req.params.userId, (err, doc) => {
        if(!err) { res.send(doc); }
        else {console.log('Error in Insurance agent Delete :' + JSON.stringify(err, undefined, 2)); }

    });
});

enter image description here

0 个答案:

没有答案