Tell us what’s happening:
I’m getting an alert that model.remove() is deprecated.
So far, so good. When downgrading to mongoose ~4.x.x, it’s still not working.
Changing the method to deleteMany() or so doesn’t solve the exercise, but I think it should…
Now, anyway, this is the code I’ve been using so far.
Your code so far
const removeManyPeople = (done) => {
const nameToRemove = “Mary”;
Person.remove({name: nameToRemove}, (err, response) => {
if(err) return console.log(err);
done(null, response);
})
};
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0
Challenge: Delete Many Documents with model.remove()
Link to the challenge: