Tell us what’s happening:
I need to delete many documents with Model.remove() query of Mongoose
But, Model.remove() is deprecated Mongoose v6.2.1: Deprecation Warnings
and thus npm shell is throwing an error (deprecated) when fcc tries to test my localhost
Tried to use deleteOne() and deleteMany() as suggested in the docs, but can’t pass the test.
Is there a way to turn off deprecated error? So that fcc can test it.
or is something wrong with my code?
Code:
const removeManyPeople = (done) => {
const nameToRemove = "Mary";
Person.remove({name: nameToRemove}, (err, removedItems) => {
if(err) {
done(err)
} done(null, removedItems)
})
};
Your project link(s)
solution: http://localhost:3000
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36
Challenge: Delete Many Documents with model.remove()
Link to the challenge: