MongoDB and Mongoose - Delete Many Documents with model.remove() - CjohcAZxBOfWNLS0ZxLot

Tell us what’s happening:
Describe your issue in detail here.

Person.removeMany({ name: nameToRemove }, (err, data) => {
if(err) {
done(err);
}

done(null, data);

})
};
Here is my code and they keep telling me: “Deleting many items at once should succeed”. I’ve also tried a every code posible and they still don’t accept my link. Please help me :frowning:

Challenge: MongoDB and Mongoose - Delete Many Documents with model.remove()

Link to the challenge:

It might have something to do with the version of your mongoose. Do you have the same version as instructed here?

Yes. I also installed mongoose and mongodb versions. Everything was fine until this challenge. Even the last challenge I made it but it still doesn’t work

Why are you using removeMany instead of remove?

I’ve used remove and than removeMany. I don’t know why it doesn’t work :frowning:

mind if you share your replit? or glitch

Is that a screenshot? A link would help

Does it work to open it?

Change your Mongo Atlas’ password immediately, it’s exposed in this link. You should use an environment variable in this situations.

Like what? You can explain for me please?

This explains how to use the environment variable

If you’re done fixing it, you can send back the link

Should I make a new secret .env for something?

I have one for MONGO-URI

You do not have the correct version of mongoose installed from the looks of it (I looked in the node_modules folder).

From the Shell tab run.

npm rm mongoose
npm i -E mongoose@5.4.0

what version should I install? I

yes, connect that variable to mongoose

Just run the commands I gave you.


Looking at your package.json it also looks like you have an old version of the starter project.

How did you get it? Did you use the Replit starter project link? Because the version you have isn’t correct.

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