MongoDB

How to get MongoDB URI

1. First, Go to mongo.com then Sign Up there.

Sign up on Mongo Db first of all

2. Login or Sign Up (Create an Account) there. If you don’t have an Account!

Sign up with Google or Temp mail whatever you want

3. You'll see a deploy cloud database option. Please select Shared Hosting under Free Plan Here

Select the server location nearby your location, So that it work fast and efficient.

Select free hosting and Select your server and region now.

4. Your database cluster is being created now. It can take upto 2-3 mins. Till then we can set other settings.

Please wait, Till its being created.

5. Click on QuickStart under security tab. Input any username and password there and press create user.

Don't use any special character in your username or password like !@#$% etc... Make it simple

Create a user now.

6. Scroll down to configure Network Access. Click on Add IP Address.

make sure its 0.0.0.0/0 and click Confirm

Add an ip address

7. We have successfully configured Mongo Db now. Its time to connect it. Goto Database section and click on connect.

Click on connect

8. Configure the connection setting here. Select the user and under drivers select python as language.

And then copy the mongodb URI.

19. We have succesfully got our MONGO DB URL now. Replace <password> with your password and use it.

mongodb+srv://stranger:<db_password>@stranger.quc2tlw.mongodb.net/?retryWrites=true&w=majority&appName=Stranger

Replace the <password> with the actual password for the user you configured in the step 5

Final MongoDB URI looks like this

mongodb+srv://stranger:stranger@stranger.quc2tlw.mongodb.net/?retryWrites=true&w=majority&appName=Stranger

Last updated