MongoDB | Getting Started

By September 18, 2021MongoDB Learning

All commands mentioned need to be run on mongo shell

1) To see list of database

show dbs

It will show list of Databases along with the size. If a databse is empty, it won't be shown by the command.

2) To use a database

use databaseName

It will switch to the databaseName databse (If database won't exists, it will create one)

3) To see which database is in use


It will return the database currently in use

4) Seeking Help

To show available functions

To show available functions with database

5) Delete Database


To drop the database


  • If familiar with SQL, the tables are called collections and records are called documents in MongoDB