Introduction
The MongoDB Compass is one of the best MongoDB Graphical User Interface tools in 2019. It is a desktop tool to analyze and understand our Database with ad hoc queries in seconds. It also has a cross-platform GUI to facilitate the modern front end for MongoDB. For more information, see MongoDB Compass.
Prerequisites
Now, let’s get started with the following steps.
Step 1 - Connect to MongoDB
First of all, we run the “mongod” at CMD to enable the MongoDB instance. It handles all MongoDB server tasks such as requests, responding to client, and memory management.
Now, open the MongoDB Compass which has the responsibility of user required access and favorite connections. When you opened the Compass, then it will ask you few authentication credentials for connecting localhost along with its port.
- Hostname – localhost (default hostname)
- Port – 27017 (default port)
After doing the above instruction, click Connect.

Step 2 - Create a Database
- Let’s create a new Database by clicking the “Create Database” button which is located at the top right side of the Compass Home. In the Create Database dialog, you can give the Database Name and follow by the Collection name for the first collection like “newDB” and “collection1” then click “CREATE DATABASE” button.

Step 3 - Create a Collection
From the Collection tab, click on the “CREATE COLLECTION” button to push up the Create collection dialog. Enter the Collection name and click “CREATE COLLECTION”.

Step 4 - Insert Document
- Collection1>> INSERT DOCUMENT

In the Insert document dialog >> insert field and Value>> Data types.

Next, we want to add a new Field after the name, click plus icon (+) under the name and follow the above discussed instructions.

Step 5 - Delete operations
Drop document
From the Documents tab, click on a document that you want to delete. Then there will appear a small trash icon from the document tab >> Delete.

The selected document has been highlighted with red to indicate it's currently ready for deleting. Click on “DELETE” button.

Drop Collection
From the Collection tab, click on the trash icon. In the Drop Collection dialog, just give the exact collection name which needs to delete then click “DROP COLLECTION” button.
Drop Database
Click on the trash icon of the database >> Enter database name>> DROP DATABASE.
Step 6 - Update Document
Click on the pencil icon which is visible when you choose your document that needs to be modified.

Here, we have changed all values of the document that highlighted with yellow color. Click on the “UPDATE” button to achieve that.

Step 7 - Read document
Here, we will find our specified field at the number of documents.
Click on the “Option” button at Line editor and give a filter query which field you need to search then hit the “FIND” button.

After finding our desired filter, we will get our exact find document.


manikandan PalanisamyPosted Aug 15, 2019, 8:04 PM
really good updation
Guest UserPosted Aug 15, 2019, 11:53 AM
Nice explanation..All the best.
Pradeep SelvamPosted Aug 15, 2019, 11:20 AM
all the best keep sharing
Kokila RaniPosted Aug 15, 2019, 12:17 AM
Interesting.. simple and clear explanation. easy to understand to me , keep sharing . All the best .