freeCodeCamp Challenge Guide: Delete One Document Using model.findByIdAndRemove

Delete One Document Using model.findByIdAndRemove

This is a stub. Help the community by making a suggestion of a hint and/or solution. We may use your suggestions to update this stub.


Problem Explanation

This summarizes what need to be done without just restating the challenge description and/or instructions. This is an optional section

Relevant Links


Hints

Hint 1

Hint goes here


Solutions

Solution 1 (Click to Show/Hide)
var removeById = function(personId, done) {
  Person.findByIdAndRemove(
    personId,
    (err, removedDoc) => {
      if(err) return console.log(err);
      done(null, removedDoc);
    }
  ); 
};

Code Explanation

  • Code explanation goes here

Relevant Links

5 Likes