Mongo DB Shell Command – Create Database
- Connect to shell by running mongo
- To create a database, enter Use command in the shell. (The command will create a new database, if it doesn’t exist, otherwise it will return the existing database)
- You need to insert at least one document to make it display in the db list command. Enter db..insert({name:”test”})command to create the first document.
Reference
http://www.tutorialspoint.com/mongodb/mongodb_create_database.htm
Happy Coding! 😇
This post is licensed under CC BY 4.0 by the author.
Comments powered by Disqus.