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?
Modify the removeManyPeople function to delete all the people whose name is within the variable nameToRemove , using Model.remove() …
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.
NOTE that Model.remove deletes all matching documents, while Model.deleteOne deletes the first matching document (deletes at most one document only).