Hello, I seem to be stuck setting up my database using mongodb and connecting through mongoose. This is being run on glitch through the fcc boilerplate.
My .env file
I am getting an UnhandledPromiseRejectionWarning error and when I run it through the fcc test it detects the mongodb and mongoose dependencies but throws out
// running tests
mongoose is not connected
// tests completed
and fails the mongoose should be connected to a database test.
double check your connection string, if you want, you can post a link to your glitch file and I can check with a working connection string if that really is your problem. For example
here @ds0 the zero is not a constant, all you have to do is only replace the dbuser and dbpassword fields from the template mlab provides.
Just checked, it works fine with a working connection string, other than a deprecation warning due to not passing { useNewUrlParser: true } option to client, but that is normal, so again check your connection string.
What is the solution to this problem? I’m having the exact same issue where I can’t connect to Mongoose. I made sure to whitelist my ip address, does not fix the problem. Also, my uri looks different, as it is no longer possible to get an mlab uri. The current uri looks like:
The issue is that the FCC instructions were made before the acquisition of mlab by mongodb Atlas and need to be updated, but meanwhile, here is a list of things that need to be done that I am updating as things show up to make the lessons work.
In order to keep things related specifically to this topic in a thread I can track, I am locking this one and other similar threads that may pop up as more users attempt to do these lessons.