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.
Similar Reads
MongoDB - Create Database using Mongo Shell
MongoDB is a popular NoSQL database that uses collections and documents, which are highly flexible and scalable. Unlike relational databases (RDBMS), MongoDB does not use tables and rows but stores data in a more dynamic, JSON-like format. In this article, we'll explore how to create a MongoDB datab
4 min read
How to create new Mongodb database using Node.js ?
mongodb module: This Module is used to performing CRUD(Create Read Update Read) Operations in MongoDb using Node.js. We cannot make a database only. We have to make a new Collection to see the database. The connect() method is used for connecting the MongoDb server with the Node.js project. Please r
1 min read
How to Create Database and Collection in MongoDB
MongoDB is a widely used NoSQL database renowned for its flexibility, scalability, and performance in managing large volumes of unstructured data. Whether youâre building a small application or handling big data, MongoDB offers an easy-to-use structure for managing your data. In this article, we wil
6 min read
How to Connect to a MongoDB Database Using Node.js
MongoDB is a NoSQL database used to store large amounts of data without any traditional relational database table. To connect to a MongoDB database using NodeJS we use the MongoDB library "mongoose". Steps to Connect to a MongoDB Database Using NodeJSStep 1: Create a NodeJS App: First create a NodeJ
4 min read
How to Connect Node to a MongoDB Database ?
Connecting Node.js to MongoDB is a common task for backend developers working with NoSQL databases. MongoDB is a powerful, flexible, and scalable database that stores data in a JSON-like format. In this step-by-step guide, we'll walk through the entire process from setting up your development enviro
6 min read
Install MongoDB Compass on Windows
MongoDB Compass is a powerful graphical user interface for MongoDB which is designed to simplify database management. It offers features like easy querying, index visualization, an aggregation pipeline builder and schema and structure analysis. In this article, we will learn How to Install MongoDB C
5 min read
MongoDB Compass
MongoDB Compass is a graphical user interface (GUI) tool designed to simplify working with MongoDB databases. It provides a visual, user-friendly environment to manage databases, explore data structures, and streamline operations. With powerful features like data visualization, query building, and r
6 min read
MongoDB Compass vs MongoDB Atlas
MongoDB is a widely-used NoSQL database known for its flexibility, scalability, and high performance. Two key tools associated with MongoDB are MongoDB Compass and MongoDB Atlas, each serving distinct purposes. While MongoDB Compass provides a graphical interface for managing databases locally, Mong
5 min read
Mongoose Model.create() API
In Node.js applications, Mongoose provides an effective way to interact with MongoDB, allowing developers to define models and schemas to store and retrieve data. One of the essential methods provided by Mongoose is Model.create(), which is used to create one or more documents in a MongoDB collectio
6 min read
MongoDB - Database, Collection, and Document
MongoDB is a popular NoSQL database that offers a flexible, scalable, and high-performance way to store data. In MongoDB, Databases, Collections, and Documents are the fundamental building blocks for data storage and management. Understanding these components is crucial for efficiently working with
9 min read