After connecting to your database using mongosh
, you can see which database you are using by typing db
in your terminal.
If you have used the connection string provided from the MongoDB Atlas dashboard, you should be connected to the myFirstDatabase
database.
To see all available databases, in your terminal type show dbs
.
Notice that myFirstDatabase
is not listed. This is because the database is empty. An empty database is essentially non-existant.
You can change or create a new database by typing use
then the name of the database.
We are now in the blog
database.
Remember: In MongoDB, a database is not actually created until it gets content!
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!