Delete Many Documents with model.remove() - test not passing

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:

I do not see anything wrong with it after I changed Person.deleteMany to Person.remove and posted it into my replit , It passed for me. My internet is sub 3Mbps , so I had to submit twice before passing.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.