Using Compass – The GUI tool for interacting with MongoDB

by: Meera M Bastian

MongoDB is the most popular NoSQL database. Unlike SQL,MongoDB isn’t based on the table-like relational database structure. Data is stored in a format called BSON (similar to JSON format) and use MongoDB query syntax for doing the operations.

MongoDB Compass is a graphical interface to interact with the MongoDB database management system. It comes in handy as it does not require prior knowledge of MongoDB query syntax. It is a convenient tool for Testers as it allows to perform the CRUD operations without manually writing queries.

Things to do:

  1. Download and install Mongodb compass in your system
  2. Once downloaded, connect to a host which can be done either by providing the connection string or by filling in the connection fields individually


  1. After collection is successfully established, you will be able to see the document and collections in it.

  1. Now, click on the collection in which you need to work. Under the options, enter the different criteria based on your action like filter, sort etc.

Here it retrieved the data based on the input given as userid = “198358” and sorted it by created date.

  1. We can add multiple criteria in the filter like below to fetch the data based on our requirement.

  1. Advanced options are also available here – like export data, Aggregations tab to use aggregate functions , explain plain to know the performance of query, indexes to view the indexes used in the collections,validation rules to view the constraint set during insert/updates.

  All these actions required to validate a MongoDB application, can be performed in compass, without the hassle of learning a new querying language syntax. MongoDB Compass is thus a champion for QA/BA’s working with MongoDB.

Relevant posts

The Chatbot Testing

Imagine visiting a new website. A lot of things pop up on the homepage. One such pop-up is a virtual chat box with someone from the company that can answer all your preliminary questions and queries and redirects you to the related page on the website or the concerned people in the company.

Tale of Exhausting API Regression to Efficient Automation with Postman

Performing API regression testing manually and not getting the desired result is a meticulous task and it also requires to re-run the APIs multiple times just to make sure the outcome you are getting is still, correct.