Tell us what’s happening:
Test will not pass, though it matches the solution. All data gets deleted instead of just items with {name: “Mary”} if I follow the solution. I’ve tried many different ways and cannot get test to pass.
The template doesn’t work for version 6+ of mongoose.
For anyone having the same problem, please change your version of mongoose to be 5.13.8 in the package.json, then click Run (on repl.it) and try again:
Your function takes only one argument - done.
How does it know what name to remove?
If I would like to remove name “Napoleon”, how would I call that function to do it?
Chris is doing what the task asks him to do, so it’s OK .
It would be an error in a real life app, I agree, but if Chris fixes it, and we take into account that the challenge asks him to not edit the server.js file, it will not work.
Ah, ok.
I did this a few weeks ago, but no server.js editing that I recall.
Also looked at my own code and it too was not taking another argument, but it passed the tests, strange.
Could you check, on your solution, which versions of mongoose and mongodb you have installed? (Or share the link to your solution through a private message, please).
Thank you So Much Skaparate. This resolved my issue! I thought it may be version related but was not sure which version to downgrade to.
The initial course instructions do not state which version to use. Below I’ve pasted in the instructions. I would recommend updating this section to state which versions to add which would avoid this problem for others. I assumed latest version if none provided.
Add mongodb and mongoose to the project’s package.json . Then, require mongoose as mongoose in myApp.js .