Tell us what’s happening:
Hello. I can’t pass the test. Tried everything: creating a new database, downgrading mongoose, using deleteMany, deleteOne, bulkWrite instead of remove. Nothing works. I don’t know what’s the problem. Here’s my code:
const removeManyPeople = (done) => {
const nameToRemove = "Mary";
Person.deleteMany({name: nameToRemove}, (err, removedData) => {
if(err) return console.log(err);
done(null, removedData);
});
};
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36
Challenge: Delete Many Documents with model.remove()
Link to the challenge: