Arun Kumar T
0
Q:

how to create database in mongo db command

use databaseName  //create a database in the mongodb instance
db.colletionName.insertOne{name:"First document"}// insert a colletions into the db
//the db will only be created when a collection is present inside of the db
OR
use databaseName
db.createCollections("collectionName")

show dbs //to check if database was added
0
use DATABASE_NAME
1

New to Communities?

Join the community