I am encountering an issue where one specific document does not update, although the same query successfully updates any other _id that I query:
Category.findOneAndUpdate(
{_id : req.params.id},
{parent : req.body.parent},
function(err,obj){
console.log(err,obj)
if(err)
res.status(500).send(err);
else
res.send(200);
}
)
Interestingly, the callback function does not return an error. It behaves as if the update was successful or as if the document is not found.
In addition, when performing a simple .find({_id:id})
, the document is located, but updating to the same id seems to be ineffective.