MongoDB TutorialLesson 4Free preview
MongoDB Create DB
This lesson is part of MongoDB · All levels
Summary
This lesson shows you how to create a database in mongosh using the use command, then verify it with show dbs. The creation is lazy: new databases are stored and appear after having a collection of data. The db.getSiblingDB() command can also be used to select a database without changing context.
Key points
- Use <nama> to create and select an active database
- Show dbs does not display an empty database that does not yet contain data
- Db always refers to an active database
- GetSiblingDB() Select other databases without changing the active context
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.