Create Database in MongoDB: Quick Guide

To create a database in MongoDB, you use the “use” command. By entering the “use” command in the MongoDB shell and specifying the name of the database you want to create, MongoDB will automatically create that database. If the specified database already exists, it will switch to that database. For example, to create a database named “mydatabase”, you can enter the following command in the MongoDB shell:

use mydatabase
bannerAds