Search code examples
node.jsmongodbmongodb-atlas

connect to mongodb when you have Google login as credentials for Mongodb Atlas


I have google Atlas account, which is using my google credentials to login. What password should I use to connect to the DB from my NodeJS application (not specific to NodeJS, but any application) when I have google credentials as login credentials.

This is my connection string, what should I use in password?

mongodb+srv://kushalseth:<password>@node.zzzzzz.mongodb.net/?retryWrites=true&w=majority

I don't want to impact the google login for my atlas account as well.


Solution

  • I tried lots of things to connect to mongodb using google login. but finally found an alternative. In this way I retained my gmail login and got a user and password to connect using the url.

    I went to Atlas at https://cloud.mongodb.com/,

    • I opened my Project in Atlas, and opened Database Access.
    • In Database Access, I have created a new User, and gave it all the admin rights and there I found the option to provide password for this new user.

    enter image description here