Not sure how to connect to my cluster. The instruction provided by freeCodeCamp.com and the instruction on MongoDB is very confusing please help Thanks!
Here is a screen shot:- First one is the instruction by freeCodeCamp.com
the Second one is by mongodb
I had a problem connecting to the database because I had my MONGO_URI set inside the sample.env
What fixed the problem is to create a new file with the name .env and put the URI there.
Hope this helps anyone else
You are not supposed to use the sample.env file. It is common practice to include sample.env files in GitHub repos, because it is bad practice to include .env files (especially if they contain things like database passwords).
So, a sample.env file is provided with the bare minimum, which you are expected to clone, and add your values to in a .env file.
If you have any more questions about this subject, or your own code, I recommend you open a new topic for it on the forum.