EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 360+ Courses All in One Bundle
  • Login

MongoDB Compass

By Sulaksh MoreSulaksh More

Home » Data Science » Data Science Tutorials » MongoDB Tutorial » MongoDB Compass

MongoDB Compass

Introduction to MongoDB Compass

MongoDB, one of the most widely used NoSQL Database, provides a GUI (Graphical User Interface), MongoDB Compass. MongoDB Compass allows you to interact actively and understand the data stored in MongoDB Database, without any prerequisite to have any knowledge of Coding or Shell Queries.

MongoDB Compass’s Connect Page:

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

Below is a screenshot of Compass’s Connect Page.

MongoDB Compass-1.1

To connect the MongoDB Compass to the active MongoDB Instance, we have to fill in the above image’s details and then connect. It will connect the currently active instance of running MongoDB to the compass, and the data can be visualized.

Other than being able to read data, Compass allows you to present the data visually. Managing Indexes and the implementation of Document Validation is also effectively done by Compass.

Why do we Need MongoDB Compass?

Flexible schema and JSON like Document storage, provided by MongoDB, is a really great tool for developers to build applications over the database and work as a kind of obstacle to understand the structure of the database. You can certainly execute queries and understand the structure, but it was only possible for developers with MongoDB knowledge. But with MongoDB’s Compass, we now have multiple ways to understand the data and manipulate it without any knowledge of shell commands.

Introduced with MongoDB 3.2, Compass is a graphical tool to understand the data in an easy way and interact with the database without queries.

How does MongoDB Compass Work?

Basically, Compass is a GUI for what we have within our MongoDB Database. Every collection and documents can be reflected and manipulated. Every time we build and execute a query on the compass, it interprets the query into the command line query and executes it. Upon execution, whatever the result is, it reflects the result of the graphical visualization.

Popular Course in this category
MongoDB Training Program (4 Courses, 2 Projects)4 Online Courses | 2 Hands-on Projects | 22+ Hours | Verifiable Certificate of Completion | Lifetime Access
4.5 (5,421 ratings)
Course Price

View Course

Related Courses
Oracle Training (14 Courses, 8+ Projects)All in One Data Science Bundle (360+ Courses, 50+ projects)SQL Training Program (7 Courses, 8+ Projects)Oracle DBA Database Management System Training (2 Courses)MS SQL Training (13 Courses, 11+ Projects)

Features of MongoDB Compass

Basically, Compass itself is an advantage and a reason to use MongoDB. That being said, Compass comprises amazing features that make it more likely to be implemented for production uses. Let us now Define and understand every feature that compass offers:

1. Query

Creation and execution of queries can be done with the Compass interface. Aggregation Pipelines can be created and executed over the compass as easily as any normal query.

Example: In the below image, we have created a simple query to find records or documents, which consists of Pune as a city, and as a result, we have 2 records.

MongoDB Compass-1.2

This is equal to db.educba.find() query on the shell.

2. Indexes

Just like queries and aggregation pipelines can be created and executed with a compass, Creating and Deleting Indexes for MongoDB Collection, is easy with Compass. In the following screenshot, we have three indexes that already exist.

MongoDB Compass-1.3

Here we have a “CREATE INDEX” Button, which is used to create indexes. Then we have a list of our indexes, for Name, _id, and email. One important thing here is that except _id all other indexes can be deleted because _id index is default and automatically created when we insert a single record. Rest, we have all other details surrounding the index.

3. Rules

Along with Documents, we have Document Validation Rules, which can be created, edited, and deleted, from the compass.

4. Interaction

Without Compass, the only way to interact with Databases, Documents and Collections was with the MongoDB Shell, with Commands. But with Compass out in the market for usage, it has been tremendously easier for non-technical persons to interact with the database. CRUD Functionalities, which means Create, Read, Update, and Delete, can be executed, data can be easily manipulated. In the below screenshot, we are attempting to edit the value for one of the keys. The Name key will be updated here, instead of executing a db, update query.

Output-1.4

5. Reporting

To report and analyze, any unusual event or errors or bugs, is an important part of any database or a system, in order to improve. Crash reporting is done effectively in Compass, along with collecting error logs and steps to improvise.

6. Explain

We have an Explain Plan Tab with MongoDB Compass, which reflects the execution plan for a query. Refer below the image for better understanding.

Output-1.5

Simply, fill in the query and click on explain. It will then fetch every detail related to that query like Documents Returned, Execution Time, Documents examined, and several index keys examined.

7. Schema

Compass provides you with a better way to visualize your schema, helps you to analyze the document. It supports exploring the schema to understand the types and frequency of the data set. This is an important feature, as we know that MongoDB has a different flexible schema. Start by typing in a query, modify if necessary and then apply, this will go deep into the database or the respective collection and fetch the matching documents. Upon successful, fetching operation, it will present the data in a visual format. Refer to the below screenshot for proper output.

Upon executing, it returns every aspect of the query, which is the number of documents fetched, then we have the keys, meaning “_id, city, loc”, which defines the documents. Most of the analytical insights regarding the document, data, and the query can be learned from the schema Analysis.

Output-1.6

8. Performance

Compass is one of the best ways to analyze the data and performance of the database. With the help of visual plans, performance for queries can be viewed and optimized, too.

Advantages and Disadvantages

Following are the advantages and disadvantages of using MongoDB Compass:

Advantages

  • Easy to Use, Simple GUI.
  • Query Building and Executing.
  • Reporting.
  • Performance Analysis.
  • Monitoring Indexes.

These advantages make the MongoDB Compass better equivalent to use when interacting with MongoDB Data.

Disadvantages

Basically, Compass is all in one great tool. With stable updates, the Compass is being improved regularly. Free to Use but Limited Features.

Conclusion

To wrap it up, MongoDB Compass is easy to use, GUI, a simple tool to analyze the data stored in the collections. Features like Indexing, Performance, Query and Aggregation Pipeline Building and many more advantages, makes this tool easy to use. Compass is a great tool to understand and manipulate the data for any person without any knowledge of command-line queries.

Recommended Articles

This is a guide to MongoDB Compass. Here we also discuss the Introduction and how does MongoDB compass work? Along with features, advantages, and disadvantages. You may also have a look at the following articles to learn more –

  1. Indexes in MongoDB
  2. MongoDB Limit()
  3. MongoDB Collection
  4. Lookup in MongoDB
  5. MongoDB Unique | How to Work?
  6. MongoDB vs Elasticsearch | Infographics
  7. MongoDB insert | How to Work?
  8. Guide to MongoDB Update

MongoDB Training Program (4 Courses, 2 Projects)

4 Online Courses

2 Hands-on Projects

22+ Hours

Verifiable Certificate of Completion

Lifetime Access

Learn More

0 Shares
Share
Tweet
Share
Primary Sidebar
MongoDB Tutorial
  • Advanced
    • MongoDB Array
    • PostgreSQL ARRAY_AGG()
    • Indexes in MongoDB
    • MongoDB create Index
    • MongoDB Collection
    • MongoDB List Collections
    • MongoDB Capped Collections
    • MongoDB Auto Increment
    • MongoDB Projection
    • Replication in MongoDB
    • Mongo DB Create Database
    • MongoDB Compass
    • MongoDB Users
    • MongoDB Authentication
    • MongoDB GridFS
    • MongoDB Relationships
    • MongoDB Monitoring
    • Backup in MongoDB
    • MongoDB Sharding
    • MongoDB Java Drivers
    • MongoDB Import
    • Mongo Database Interview Questions
  • Basics
    • What is MongoDB
    • How To Install MongoDB
    • MongoDB Tools
    • MongoDB GUI Tools
    • MongoDB Versions
    • MongoDB Commands
    • Advantages of MongoDB
    • MongoDB Features
    • Is MongoDB NoSQL
    • Is MongoDB Open Source
    • Build Web Applications using MongoDB
    • MongoDB vs Elasticsearch
    • MariaDB vs MongoDB
    • Firebase vs MongoDB
  • Commands
    • MongoDB Limit()
    • MongoDB count
    • MongoDB Aggregate
    • MongoDB Distinct
    • MongoDB Unique
    • MongoDB find
    • MongoDB insert
    • MongoDB Delete
    • MongoDB Update
    • Lookup in MongoDB
    • order by in MongoDB
    • MongoDB $regex
    • MongoDB $elemMatch
    • MongoDB ObjectId()
    • MongoDB Skip()
    • MongoDB Date Query
    • MongoDB Timestamp
    • MongoDB sort()
    • MongoDB group by
    • MongoDB Join

Related Courses

MongoDB Certification Course

Oracle Certification Course

All in One Data Science Course

SQL Training Course

Oracle DBA Course

MS SQL Certification Course

Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

© 2020 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA Login

Forgot Password?

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you
Book Your One Instructor : One Learner Free Class

Let’s Get Started

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

Special Offer - MongoDB Training Program (4 Courses, 2 Projects) Learn More