MongooseServerSelectionError: connection <monitor> to 34.202.149.80:27017 closed

Hello, I am following this tutorial for an economy series, this video is about adding a database with MongoDB
Link: https://www.youtube.com/watch?v=M6QPcuGmGNw

Now I got the error that you can see in the title. The error brings me to this code:

mongoose.connect(config.mongoPass, {
useNewUrlParser: true,
useUnifiedTopology: true,
})

please help me…I’ve been trying to fix for hours. I also tried to add my glitch project to the ip but i might have done it wrong, i don’t really know if that was the right ip.

It may be because the second object/argument ends with “,” ?

mongoose.connect(config.mongoPass, {
useNewUrlParser: true,
useUnifiedTopology: true
})

Try testing with that and you can also add “try” and “catch” to get a more specific problem.

(If the problem persist try updating your version of mongoose | npm update mongoose)