There are simple steps to be followed to get the MongoDB Atlas connection string, topics to be included:
- Getting Connection String
- Installing & for Visual Representation: MongoDB Compass
- First, go to the Account MongoDB & make an account.
- In the top left corner, click on the folder section & add +New Project.
- For creating a project first, Name Your Project & then press Next.
- You can change the ownership. Go to Give your members access permission below & change accordingly. Then, press Create Project.
Note:
On the top, if there is a warning that Your organization does not have a designated security contact. Go to the Organization Settings & under Atlas Security Contact information. Press the Edit Sign on the right side to add your Gmail address. Then, press Save.
- Now, create a Cluster by pressing + Create.
- Choose the Free one with STORAGE 512MB, RAM Shared, and vCPU Shared.
- If you want to rename the cluster, you can. Then press Go to Advanced Configuration.
- Choose the Free one & check out the Cloud Provider & Region and other configurations. Then press Create Cluster.
- In the Security QuickStart under Username & Password. Re-enter the desired username and password. Then, press Create User.
- In the bottom, under Add entries to your IP Access List.
- First, Add My Current IP Address and Add Entry.
- Then go to the Network Access Page shown above the IP Address.
- In the Network Access, under IP Access List. Press +ADD IP ADDRESS.
- Press ALLOW ACCESS FROM ANYWHERE; you can see the 0.0.0.0/0 being shown in the Access List Entry:. Then, press Confirm. Now, you will notice that the Status can have three states:? Pending, Inactive & Active. Wait until it gets Active.
- Go Back to the previous page & Refresh, you will notice that the 0.0.0.0/0 has been added to the IP Access List. Press Finish and Close.
- You got it?, you have set up the access rules. If you want to confirm & re-verify, you can go to the Database Access & Network Access or Press Go to Overview.
- In the Overview, press Connect.
- You will get a lot of Access your data through tools. Choose Compass.
- If you don’t have the MongoDB Compass installed, Choose I don’t have MongoDB Compass installed.
- Check upon the operating system & then press Download Compass(version).
- Copy the connection string & then press Done.
- Congrats? on getting up the MongoDB connection string. Now, you must do the further steps in MongoDB Compass.
- Open the MongoDB Compass, press + Add new connection.
- In the New Connection, under URI. Paste your connection string here.
Note:
mongodb+srv://chootabheem:<db_password>@cluster0.gp7hi.mongodb.net/?
It’s most likely, that your connection string will be similar as the above.?You have to put in your password in place of <db password>.? mongodb+srv://chootabheem:[email protected]/?
Like this!
- Then, the Name of your choice. Press Save & Connect.
- On the left side, you can check the name of your database & all is done.