DIna
July 12, 2022, 9:50pm
#1
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
Challenge: MongoDB and Mongoose - Delete Many Documents with model.remove()
Link to the challenge:
xynoan
July 12, 2022, 9:53pm
#2
It might have something to do with the version of your mongoose. Do you have the same version as instructed here ?
DIna
July 12, 2022, 9:55pm
#3
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
xynoan
July 12, 2022, 9:57pm
#4
Why are you using removeMany
instead of remove
?
DIna
July 12, 2022, 9:59pm
#5
I’ve used remove and than removeMany. I don’t know why it doesn’t work
xynoan
July 12, 2022, 10:00pm
#6
mind if you share your replit? or glitch
xynoan
July 12, 2022, 10:03pm
#9
Is that a screenshot? A link would help
xynoan
July 12, 2022, 10:16pm
#12
Change your Mongo Atlas’ password immediately, it’s exposed in this link. You should use an environment variable in this situations.
DIna
July 12, 2022, 10:17pm
#13
Like what? You can explain for me please?
xynoan
July 12, 2022, 10:22pm
#14
This explains how to use the environment variable
xynoan
July 12, 2022, 10:25pm
#15
If you’re done fixing it, you can send back the link
DIna
July 12, 2022, 10:27pm
#16
Should I make a new secret .env for something?
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
DIna
July 12, 2022, 10:28pm
#19
what version should I install? I
xynoan
July 12, 2022, 10:30pm
#20
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.