I\'m trying to connect to my mongoDB server via the connection string given to me by mongo:
"mongodb+srv://david:p
Works great!!
I forgot to update the user after generating and copying the password and was wondering why it wasn't working. I saw the update button later. I was not visible to me earlier. lol. Solved the problem.
Database Access => edit user => generate/copy password => update it! It worked for me.
remember to make sure you have updated it.
mongodb+srv://jehat123:<password>@jehatarmancdeniz-x2yf7.mongodb.net/question-answer?retryWrites=true&w=majority
Delete all of password part
Use like this:
mongodb+srv://jehat123:yourpass@jehatarmancdeniz-x2yf7.mongodb.net/question-answer?retryWrites=true&w=majority
just remove the angel brackets from both side of your password
const db = 'mongodb+srv://username:<password>
@cluster0-re3gq.mongodb.net/test?retryWrites=true'------->wrong
const db = 'mongodb+srv://username:password
@cluster0-re3gq.mongodb.net/test?retryWrites=true'------>correct
I think you're confused with the mongodb account password and user password. You should use user password, not account password. That was the reason of my case.
I had the same problem, and in my case, the answer was as simple as removing the angle brackets "<"and ">" around <password>
. I had been trying: my_login_id:<my_password>
, when it should have been my_login_id:my_password
.