Viewing a MongoDB Database with Compass


Compass is an app that allows users to query and modify the contents of a MongoDB database.  In this tutorial you’ll install Compass, connect the app to the MongoDB database used in our class, and view the contents of the database.

Install Compass

Navigate a browser to MongoDB Compass web page, download the app and install it.

Make a Connection

Open the Compass app and press the button labelled Add new connection.

Enter the following connection string in the URI input found in the New Connection box.

mongodb+srv://joe:test1234@cluster0.qdwah.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0

Enter a name for the connection in the Name field then press the button labelled Save & Connect.

Compass will briefly display a dialog box indicating if a connection was successfully made or not.

View the Database

Once connected, expand the menu in the left panel to reveal the available database.  Expand the test database to view the users and posts collections.  Click on the posts collection to reveal in the right-hand side panel all of the posts in the database.