Glad to hear it.
Glad to hear it.
Has anybody tried this recently? I can’t connect to Mongoose. Getting the following error:
(node:14936) UnhandledPromiseRejectionWarning: MongoNetworkError: connection 3 to fcc-shard-00-00-vcnna.mongodb.net:27017 closed
It passes the first 2 tests which are that mongodb and mongoose are in the dependencies. Also, the instructions are outdated, as mlab is now mongodb Atlas and the current uri looks like this:
Could this be why it is not able to connect to Mongoose?
FCC: mlab is no longer accepting new users. Does this mean these challenges can no longer be completed? Can you please look into this?
im having the same issue as user @mscanza. That you have to use Mongo Atlas meaning i can’t follow the instructions in the challenge. Does anyone know when the (apis-and-microservices) challenges will be updated or a quick fix to be able to complete the challenge? Thank you.
I have just confirmed that the lessons still work even after the changes made from the acquisition of mlab by mongodb, these instructions need to be fully changed however, I will look to submitting a PR or see if one hasn’t already been submitted.
But, it should not stop anyone from continuing with the lessons, since the instructions in MongoDB Atlas are pretty clear, briefly…
Create your first database user, follow the instructions and create a user with a password.
Whitelist your IP address, warning here, glitch will not connect if you don’t allow all IP addresses, which is what I did for it to work.
Connect to Your Cluster> click
connectin the sandbox window, and then click
connect your applicationin the pop up window, then copy the connection string, and paste it in your .env file in glitch and substitute the password you provided in step 3 for the
<password>area , and you are good to go. Test the first lesson and it should pass.
mongoDB Atlas says it requires MongoDB version 4.0 for the free tier clusters . If you are using Mongoose, this means that you would need mongoose > 5.2 to have a compatible mongoDB driver that Atlas can use
Submit the link to your LIVE page from glitch for the challenge to pass and not the link to your glitch editor
Thank you Dereje1 this was extremely helpful. Whitelisting all ip addresses fixed it.
I cannot establish connection to database.
var mongodb = require(‘mongodb’);
const mongoose = require(‘mongoose’);
“description”: “A boilerplate project”,
“start”: “node server.js”
I forgot to mention. I’m on Ubuntu 16.04.
see here first: MongoDB and Mongoose - Install and Set Up Mongoose
Thanks for the reference Dereje1. I’m a little bit confused here. I tried to change dependencies version and it did not work out. If you know the trick, please tell…
Did you whitelist all ip addresses in MongoDB atlas as pointed out in the link I gave you ?
If you followed the instructions I posted above and still can’t get it to work post your glitch link and i’ll look into it
I think all steps suggested in your links were taken. IP addresses where white listed.
Here is a link to my Glitch.
Great thanks in advance
If you click on allow all ip addresses you should see
0.0.0.0/0 (includes your current IP address) included in your ip address list, which means you may not have done it correctly. Your glitch app connects fine for me with my own connection string…
Thank you Good Sir. It’s working fine now.
good, I have merged your thread to the main one
Hi, I’ve encountered an issue with this exercise. I believe my code is correct, however when I submitted my solution, all the tests failed, and I saw this error message on the Chrome console:
“Access to XMLHttpRequest at ‘/package.json’ from origin ‘’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.”
Does anyone know how I can fix this?
thanks for the tip on allowing all ip addresses on glitch, i was running around in circles trying to figure out why it wasnt working!