Deprecated model.remove method in mongoose package

Tell us what’s happening:
Describe your issue in detail here.
i am trying to pass the “delete many documents with model.remove” test in backend and API development course of freecodecamp but it is not accepting the solution code which i know is correct.
I also tried to copy pasting the solution given in Hint section which is same as my code but still it’s not working.
I also tried model.deleteMany instead of model.remove still not working.
please help!

here is the solution:
const removeManyPeople = (done) => {
const nameToRemove = “Mary”;
Person.remove({name: nameToRemove}, (err, response) => {
if(err) return console.log(err);
done(null, response);
})
};

Your project link(s)

solution: https://replit.com/@tarun-kr-535kr/mongoose

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0

Challenge: Delete Many Documents with model.remove()

Link to the challenge:

1 Like