No Short SRV Connection

Lecture 1 I have a cluster now and I can’t connect I don’t have a Short SRV connection option

Hey @daniel_collins_39308

Have you setup the .env file correctly? Can you share a screenshot of it? And does this post help?

The Connection string showing here is the short srv string only which is mentioned in the course. Please use the same (after replacing password) in .env file and let me know if you have any issues.

Kanika

1 Like

Ticket: Connection

Rename this file to .env after filling in your MFLIX_DB_URI and your SECRET_KEY

Do not surround the URI with quotes

SECRET_KEY=super_secret_key_you_should_change
MFLIX_DB_URI=mongo “mongodb+srv://m220student:m220password@cluster0-yekah.mongodb.net/test”
PORT=5000

Thats the one i have saved as .env, the connection string I get from connect my application is “mongodb+srv://m220student:@mflix-houak.mongodb.net/test?retryWrites=true&w=majority”

Right now after npm install and npm start im crashing because of a ‘Cannot read property ‘split’ of null’ error (uri_parser.js:40:23)

the connection string im using now is “mongodb+srv://m220student:m220password@mflix-abc.mongodb.net”
still getting the error I just posted

directory is desktop(…)\mongodb\mflix-js if that affects anything

Hey @daniel_collins_39308

Your .env file is a bit off.

Try

MFLIX_DB_URI=mongodb+srv://m220student:m220password@mflix-houak.mongodb.net/test?retryWrites=true&w=majority

Let me know

And I have tried to connect but received an error about whitelisting of the IP. Have you done this step?
In Atlas on the left you will see a Network Access tab
Then whitelist 0.0.0.0