Test connection

Now that we have set up our database and the database user, let's test the connection. On the mLab database page, you should see the section  shown in the following screenshot:

This is our connection string, using which we can connect to the database from our application or from mongo shell or from a GUI tool like Robo 3T. If you have MongoDB installed locally, you can test the connection from the mongo shell using the command as shown. Open a new Terminal/Prompt and run:

$ mongo ds211309.mlab.com:11309/smart-exchange -u admin -p admin123

We should see that the connection succeeded as shown in the following screenshot:

This ...

Get Google Cloud AI Services Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.