</>
Skip to content
MongoDB lessons (5/38)

MongoDB — Databases

Create Database

use mydb

List Databases

show dbs

Current Database

db

Drop Database

use mydb
db.dropDatabase()

Database Properties

// Get database stats
db.stats()

Use Database

// Switch to database
use mydb

// If doesn't exist, creates on first insert

Database Commands

CommandDescription
show dbsList databases
use dbSwitch database
dbCurrent database
db.dropDatabase()Drop database
db.stats()Database statistics

Mini Practice

  1. Create a database
  2. List all databases
  3. Check current database
  4. Drop a database

Up Next

Continue with Create Database — creating databases.

Related Topics

Frequently Asked Questions about Databases

What is Databases in MongoDB?

Databases is a fundamental concept in MongoDB. This lesson explains it step by step with clear examples, making it easy for beginners to understand.

How do I learn Databases?

Start by reading the explanation above, then try the code examples. Practice by modifying the examples and experimenting with different values. Hands-on practice is the best way to learn Databases.

Why is Databases important in MongoDB?

Databases is essential for MongoDB development. Understanding this concept will help you write better code and solve real-world problems more effectively.