-
Leif Christian posted an update 3 years, 2 months ago
router.post(‘/update’, function(req, res) {
StudentModel.findByIdAndUpdate(req.body.id,
{Name:req.body.Name}, function(err, data) {
if(err){
console.log(err);
}
else{
res.send(data);
console.log(“Data updated!”);
}
});
});mongoDB update route
-
pass multiple params by making them one object then destructuring on the back end
-