Tell us what’s happening:
I can’t solve that challange and i get back error that say that is collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead.
For some reason, your package.json has a different version of mongoose (which is causing the error you are seeing). Also, I see an extra package named validator. Did you change the mongoose version and add this extra package?
You should then see validator package being added.
Maybe this user cloned this a while back before we got rid of the .replit and replit.nix files.
You are correct though. If I just use the current starter boilerplate, I do not get the extra packages and package-lock.json shows the correct version of mongoose.
@ARMMM96 I suggest starting over clicking on the replit starter link again. Let us know if you run into any further problems.
I removed the original mongoose and i have installed the older version according to one of the answers here, but it didn’t work as well,
I didn’t install validator but what is the problem with other packages, what is the correlation with mongoose ? why it won’t do the delete request to the data base?
Something about the replit is corrupt. Just start a new version of the project by clicking on the starter link again. The reason it was not deleting is because for whatever reason, the replit was ignoring the mongoose version in the package.json file and installing a newer version where the remove method is deprecated.
@Sky020 Actually, now I am seeing a different issue.
I click on the replit starter link for the mongoose section.
I add my MONGO_URI to the secrets.
I copy/paste my “working” code from my local repo of the project into the myApp.js on the replit.
When I click Run I get:
Error: Cannot find module '/home/runner/boilerplate-mongomongoose-4/index.js'
Require stack:
- /nix/store/29fdcv1yhlll61ml8a31qdkrbprxd7gs-prybar-nodejs-0.0.0-67f7a00/prybar_assets/nodejs/module-context-hook.js
- /tmp/prybar-nodejs-2819920328.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.resolve (node:internal/modules/cjs/helpers:108:19)
in the replit Console. I see the same thing in the user’s new replit.
EDIT: I figured out what was causing the error I was seeing. I guess now you have to click on Done in the preview pane for the Run button to work correctly. Is that in any instructions for users?
I have started the project again all actions are working
but the only function that it dons’t work is Model.remove() or emoveManyPeople
is why the site don’t want to accept it ?