Task at work required me to connect MongoDB hosted on IBM Cloud from the Compass App on my PC. I was not able to find updated information easily over internet, so I decided to document it here.
1> Go to Resource List on your IBM Cloud Web UI.
2> Find the Mongo Db service that you want to connect to and click on it to go the service page.
3> From the overview page scroll down and click on Mongo Db under “End Points” section
4> Copy Host Name, Port, Database, Replica Set & Download the TLS certificate ( if you have SSL on, and why shouldn’t you) .
5> Now go to Service Credentials and copy the credentials
6> Now switch over to Compass App and create a connection by choosing the option, “Fill in Connection field individually”.
7> Now fill in the hostname and port copied in step 4.
8> Choose the authentication type as “Username/ Password” and copy paste the credentials from step 5.
9> Now choose More Options tab and fill Replica set Name as copied in Step 4.
10> Change SSL to server validation, if you have it set up and upload the certificate downloaded in step 4 and hit connect.
11> If you have some other configurations you might need to tweak some steps but for most SSL configs these steps should work.