DEV Community

Last_Samurai 🇧🇼🇿🇦
Last_Samurai 🇧🇼🇿🇦

Posted on

How to Create a Database in MongoDB

Creating a MongoDB Database with the CLI (the MongoDB shell)

Open your terminal and type the following:

mongo

Thereafter,

show dbs

What will be retrieved is admin and local, also note that these two instances are part of every cluster.

Now let us create own! Take note that there is no create keyword. We are going to use 'use' instead.

use myAwesomeDB

We are done. Now you need to insert your schema and data for it to reflect.

Thanks for reading!

Discussion (0)