It does not pass no matter how I fix it. I tried the remove method(deleteOne, deleteMany, remove), and I saw the corresponding data was deleted in the database, but it does not pass anyway. I checked the hint, nothing differnent from my code. How should I fix?
Your project link(s)
solution: boilerplate-mongomongoose-1 - Replit
Your browser information:
User Agent is:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/220.127.116.11 Safari/537.36
Challenge: MongoDB and Mongoose - Delete Many Documents with model.remove()
Link to the challenge:
Expected as defined in the assignment:
removeManyPeople function to delete all the people whose name is within the variable
nameToRemove , using
MongoDB and using Mongoose APIs have different methods to perform any CRUD operation (in this case deleting a document from the collection). In this assignment you are asked to use a specific method,
Model.remove deletes all matching documents, while
Model.deleteOne deletes the first matching document (deletes at most one document only).
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.