![]() |
VOOZH | about |
MongoDB is a document-oriented NoSQL database, and MongoDB Compass is a GUI tool that simplifies database interaction without complex query syntax.
MongoDB Compass is a free GUI tool that provides an intuitive way to manage and interact with MongoDB databases.
MongoDB uses a document-oriented data model that differs from relational databases like MySQL by storing data in flexible, JSON-like documents.
The Document contains the information of a STUDENT in JSON format.
{
"Name" : "Ron",
"Age" : 21,
"Gender" : "Male",
"Dept" : "CS"
}
The Bunch of documents creates a collection.
[
{
"Name" : "Ron",
"Age" : 21,
"Gender" : "Male",
"Dept" : "CS"
},
{
"Name" : "Kim",
"Age" : 19,
"Gender" : "Male",
"Dept" : "BBA"
},
{
"Name" : "Ron",
"Age" : 21,
"Gender" : "Male",
"Dept" : "HIS"
},
{
"Name" : "Alen",
"Age" : 21,
"Gender" : "Male",
"Dept" : "CS"
}
]
MongoDB Compass is a GUI tool for MongoDB that allows users to analyze and manage data without knowing MongoDB query syntax. To create a database using MongoDB Compass, the application must first be installed on the system.
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 Starts 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.
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 you'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: Click 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: 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: Click on "Insert document" a new popup appear.
Step 10: Paste or write the bunch of documents that is Collection and then Click on the "Insert" Button.
Database has created using MongoDB compass.