Create Database using MongoDB Compass
Last Updated :
27 Feb, 2025
MongoDB is a popular NoSQL database that uses a document-oriented storage model, differing from traditional relational databases. Instead of storing data in tables with rows and columns, MongoDB stores data as documents in BSON format. MongoDB Compass is a graphical user interface (GUI) that allows users to interact with MongoDB databases easily, without requiring advanced knowledge of MongoDB query syntax.
In this article, We will learn about the process of creating a MongoDB database using MongoDB Compass, from installation to managing our first database. By the end, we’ll be able to create databases and collections and insert documents into MongoDB with ease.
What is MongoDB Compass?
MongoDB Compass is a free, powerful GUI for MongoDB. It simplifies managing your MongoDB data by providing an intuitive interface to interact with our database. Using MongoDB Compass, we can create, query, update, and delete documents without the need for complex MongoDB commands. It’s particularly useful for those who prefer working with a graphical interface instead of writing queries manually.
Understanding MongoDB Document-Oriented Storage vs Traditional Relational Databases
- MongoDB is a database that utilizes a document-oriented approach to store data. It internally stores data in BSON format but as developers, we can interact with MongoDB using JSON to send and receive data.
- MongoDB handles the conversion between JSON and BSON automatically. In contrast, traditional relational databases like MySQL store data in tables. Each table represents a real-life entity and within a table, multiple rows correspond to individual data records. The columns in a table represent the properties of the entity.
- In MongoDB, data is stored in the form of documents, which are similar to JSON objects. Collections in MongoDB serve the purpose of tables in relational databases. Essentially, collections are groups of JSON-like documents.
- Each record in a collection is referred to as a document, which can be seen as the equivalent of a row in a relational database.
- A document in MongoDB is essentially a JSON object (internally stored as BSON) that contains multiple key-value pairs.
- Each key within the JSON represents a property of the entity. Thus in MongoDB the key in a key-value pair can be considered equivalent to a column in a relational database.
Example of a Document
The Document contains the information of a STUDENT in JSON format.
{
"Name" : "Rohit",
"Age" : 21,
"Gender" : "Male",
"Dept" : "CS"
}
Example of a Collection
The Bunch of documents creates a collection.
[
{
"Name" : "Rohit",
"Age" : 21,
"Gender" : "Male",
"Dept" : "CS"
},
{
"Name" : "Vivek",
"Age" : 19,
"Gender" : "Male",
"Dept" : "BBA"
},
{
"Name" : "Rohit",
"Age" : 21,
"Gender" : "Male",
"Dept" : "HIS"
},
{
"Name" : "Rohit",
"Age" : 21,
"Gender" : "Male",
"Dept" : "CS"
}
]
How to install MongoDB Compass
MongoDB Compass is a GUI interface for MongoDB. It allows users to analyze the content of their stored data without any prior knowledge of MongoDB query syntax. For Create Database using MongoDB Compass. First of all, Need to Install MongoDB Compass Application on the system.
Steps for Install MongoDB Compass
Step 1: Download the MongoDB Compass exe package from MongoDB official Website.
Step 2: After Redirect to that page Click on “Download” Button.

Step 3: After Successful Download, Open the downloaded file by double click on Downloaded File.
Step 4: After Double Click on the Downloaded File. MongoDB Compass Start Installing in your system. It takes a few seconds to install.

Step 5: After Successful Install it will be automatically opened in your system.

From the Above Steps, we have learned how to Install MongoDB Compass. Now Lets, Learn How to Create a Database using MongoDB Compass.
Steps to Create a Database Using MongoDB Database
Now that MongoDB Compass is installed, follow these steps to create your first database and collection:
Step 1: Simply Open MongoDB Compass on your system.
Step 2: After Successfully Opening, click the Connect button to connect to your MongoDB server.
Step 3: If you’re using MongoDB Atlas, copy the connection string from the Atlas dashboard and paste it into the Compass connection field. If we’re working with a local MongoDB instance, use the default connection URI: mongodb://localhost:27017.

Step 4: After connecting to MongoDB, click the plus (+) sign next to Databases on the left sidebar.

Step 5: After Clicking on Plus (+) icon, a popup will appear in which you have to give Database Name and Collection Name.

Step 6: Here we can give any Database Name and Collection Name as per your Choice. Here taking the Database name “GFG” and Collection Name “college”.
Step 7: After that Click on the “Create Database” Button.

From the above Steps Database of the name “GFG” will be Created.
Step 8: After that, click on “ADD DATA” and select the “Insert document” option.

Step 9: After Clicking on “Insert document” a new popup appear.

Step 10: Here paste or write the bunch of documents that is Collection and After after that Click on the “Insert” Button.
Database have been created using MongoDB compass.
Conclusion
Overall, MongoDB’s document-oriented storage offers a flexible and scalable alternative to traditional relational databases. By using JSON-like documents and collections, MongoDB simplifies the management of complex data structures and offers automatic conversion between JSON and BSON. Tools like MongoDB Compass further enhance user experience by providing a graphical interface for managing and interacting with MongoDB databases.
FAQs
How does MongoDB store data compared to traditional relational databases?
MongoDB stores data as JSON-like documents within collections, while traditional relational databases use tables with rows and columns. Each document in MongoDB is akin to a row in a table, and collections are similar to tables.
What is the purpose of MongoDB Compass?
MongoDB Compass is a GUI interface for MongoDB that allows users to analyze and manage their data without needing to know MongoDB query syntax. It defines the processes of database creation, data insertion and overall management.
How can I create a new database using MongoDB Compass?
To create a new database in MongoDB Compass, install the application, connect to your MongoDB instance, click the plus (+) sign to add a new database, enter a database and collection name, and click “Create Database.” Afterward, you can add data to your new database using the “Insert document” option.
Similar Reads
SQL Interview Questions
Are you preparing for a SQL interview? SQL is a standard database language used for accessing and manipulating data in databases. It stands for Structured Query Language and was developed by IBM in the 1970s, SQL allows us to create, read, update, and delete data with simple yet effective commands.
15+ min read
Introduction of DBMS (Database Management System)
A Database Management System (DBMS) is a software solution designed to efficiently manage, organize, and retrieve data in a structured manner. It serves as a critical component in modern computing, enabling organizations to store, manipulate, and secure their data effectively. From small application
8 min read
SQL Tutorial
SQL is a Structured query language used to access and manipulate data in databases. SQL stands for Structured Query Language. We can create, update, delete, and retrieve data in databases like MySQL, Oracle, PostgreSQL, etc. Overall, SQL is a query language that communicates with databases. In this
11 min read
JavaScript Tutorial
JavaScript is a programming language used to create dynamic content for websites. It is a lightweight, cross-platform, and single-threaded programming language. JavaScript is an interpreted language that executes code line by line providing more flexibility. HTML adds Structure to a web page, CSS st
11 min read
SQL Commands | DDL, DQL, DML, DCL and TCL Commands
SQL commands are essential for managing databases effectively. These commands are divided into categories such as Data Definition Language (DDL), Data Manipulation Language (DML), Data Control Language (DCL), Data Query Language (DQL), and Transaction Control Language (TCL). In this article, we will
7 min read
HTML Tutorial
HTML stands for HyperText Markup Language. It is the standard language used to create and structure content on the web. It tells the web browser how to display text, links, images, and other forms of multimedia on a webpage. HTML sets up the basic structure of a website, and then CSS and JavaScript
11 min read
React Interview Questions and Answers
React is an efficient, flexible, and open-source JavaScript library that allows developers to create simple, fast, and scalable web applications. Jordan Walke, a software engineer who was working for Facebook created React. Developers with a Javascript background can easily develop web applications
15+ min read
Web Development
Web development refers to the creating, building, and maintaining of websites. It includes aspects such as web design, web publishing, web programming, and database management. It is the creation of an application that works over the internet i.e. websites. Web development is typically broken down i
5 min read
SQL Joins (Inner, Left, Right and Full Join)
SQL joins are the foundation of database management systems, enabling the combination of data from multiple tables based on relationships between columns. Joins allow efficient data retrieval, which is essential for generating meaningful observations and solving complex business queries. Understandi
6 min read
React Tutorial
React is a JavaScript Library known for front-end development (or user interface). It is popular due to its component-based architecture, Single Page Applications (SPAs) and Virtual DOM for building web applications that are fast, efficient, and scalable. Applications are built using reusable compon
6 min read