Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mongoose find by and delete

Campground.findByIdAndRemove(req.params.id, function(err){
      if(err){
          res.redirect("/campgrounds");
      } else {
          res.redirect("/campgrounds");
      }
   });
Source by careerfoundry.com #
 
PREVIOUS NEXT
Tagged: #mongoose #find #delete
ADD COMMENT
Topic
Name
7+1 =