Answer the question
In order to leave comments, you need to log in
Why does Mongoose "delete" a document with a non-existent ID?
Good afternoon friends.
Strange things are happening.
function deleteItem(req, res) {
Goods.findByIdAndRemove(req.params.id, (err) => {
if (err) {
res.send({
success: false,
error: err
});
} else {
res.send({
success: true,
item: req.params.id
});
}
})
}
591dad9a1583ea0d1065d633
) - it is "deleted" again! Swears, only if instead of _id to transfer complete garbage, like srthrscsctrshs
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question