🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to MongoDB Notes
Topic #4

MongoDB Create DB


Create Database using mongosh

After connecting to your database using mongosh, you can see which database you are using by typing db in your terminal.

If you have used the connection string provided from the MongoDB Atlas dashboard, you should be connected to the myFirstDatabase database.


Show all databases

To see all available databases, in your terminal type show dbs.

Notice that myFirstDatabase is not listed. This is because the database is empty. An empty database is essentially non-existant.


Change or Create a Database

You can change or create a new database by typing use then the name of the database.

Example

use blog

We are now in the blog database.

Note: Remember: In MongoDB, a database is not actually created until it gets content!

Want to go beyond the notes?

Join CodingNow 2.0's MongoDB course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

MongoDB Create DB – FAQs

Quick answers about learning MongoDB Create DB in MongoDB.

This free note from CodingNow 2.0 explains MongoDB Create DB in MongoDB — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every MongoDB topic on CodingNow 2.0, including MongoDB Create DB, is 100% free with no signup required.
With focused practice, most students grasp MongoDB Create DB in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now