delete field in mongoose code example
Example 1: mongoose delete property
User.collection.update({_id: user._id}, {$unset: {field: 1 }});
Example 2: mongoose find by and delete
Campground.findByIdAndRemove(req.params.id, function(err){
if(err){
res.redirect("/campgrounds");
} else {
res.redirect("/campgrounds");
}
});