**Challenge:** Install and Set Up Mongoose

Tell us what’s happening:
Hello guys. I don’t know what i doing wrong to cannot connect to the DB. The only error i’m receiving is ‘“mongoose” should be connected to a database’. So my code is there, i did set the user, password and database name correct?

Your code so far

MONGO_URI='mongodb+srv://<root>:<password>@<Cluster0>.vcc16.mongodb.net/<Cluster0>?retryWrites=true&w=majority'

Challenge: Install and Set Up Mongoose

Link to the challenge:

Hello~!

I’ve edited your post to remove your sensitive information. As a general rule, you do not want to post the credentials for your database anywhere public.

As for the bug, have you verified that you whitelisted the requisite IP addresses in your MongoDB Atlas settings?

hello, this database is going only to be used in the test and the password is random generated, but thanks anyways !
yes i did allowed any IP’s.

My main concern is that if i’m using the correct syntax

The correct syntax will be:

mongodb+srv://<username>:<password>@cluster0-4jqem.mongodb.net/<dbName>?retryWrites=true&w=majority

You can have this generated from the MongoDB website, as well. :slight_smile:

Without this part? i mean, without the quotes and MONGO_URI?

MONGO_URI='root(...)password(...)nameDB *only example*'

You do want the variable declaration, yes.

I was trying to show the syntax for the URI string. Try removing the <> from around your “cluster0”?

1 Like

Its Done!! Thank you so much :smiley: