Home | Tutorials | Smart-Cloud | Smart-EIS | License | FAQ | Contact

Last Updated: March 24, 2021

In this tutorial, we are getting started with MongoDB compass, that is the official graphical user interface for MongoDB, We will create and drop a database, create collection, add, update and delete data.

Pre-Requisite:

Steps

  1. Open MongoDB Compass, and you should see the following screen:

Output
  1. Create New Connection, in two ways as follows:

    1. Paste your connection String (SRV or Standard), then press Connect

Output
  1. Fill in Connection fields individually, by filling Hostname, port, selecting the authentication and then press on Connect in following screen:

Output
  1. Create Database , by pressing on Create database in the following screen:

Output
  1. Fill in Database Name and Collection Name, then press Create Database in the following screen:

Output
  1. In the following screen, you should see the database that you have created in the previous step.

Output
  1. Click on the database, you should see the following screen with the collection that you named in the previous step:

Output
  1. Click on the collection, you should see the following screen:

Output
  1. Add data, in the following screen press "Add Data", in two ways Import file or Insert Document

Output
  1. Import File, by browsing the file you want to import and selecting Input Type File, then press IMPORT and the data will be imported

Output
  1. Insert Document, then fill the data and then press INSERT

Output
  1. Edit Document, hover over the document that you want to edit and press Edit Document, apply the changes then press UPDATE, as in the following screens:

Output
Output
  1. Delete Document, hover over the document that you want to delete and press Delete Document and then press DELETE

Output
Output
  1. Find Data, Fill in the field and the value, then press FIND, then the data will be filter according to the inserted field and value.

Output
Drop database drops all tables in the database and deletes the database. Be very careful with this statement!
  1. Finally, how to drop a database, in the left side section, hover over the database that you want to drop and press the trash can with tool tip Drop database, as in the following screen:

Output

Home | Tutorials | Smart-Cloud | Smart-EIS | License | FAQ | Contact