MongoDB use DATABASE_NAME is used to create database. The command will create a new database if it doesn't exist, otherwise it will return the existing database.
Basic syntax of use DATABASE statement is as follows −
Select a database :
If you want to use a database with name <myMangoDB>, then use DATABASE statement would be as follows −
switched to db myMangoDB
To check your currently selected database, use the command db