π Using the library database
Select the library databaseβ
π» We'll use the library
database for all of the hands-on exercises in this lab.
If you haven't already, import the library data into your database cluster.
- Atlas UI
- MongoDB Shell
Select the correct database in the aggregation pipeline builder.
To do that, in a MongoDB shell type in:
use library
You can show all collections with
show collections
π¦ΈββοΈ π» How would you switch to a database called orders
?
Extra activity, do it if you have extra time or are following at home, won't be covered during the hands-on lab.
Answer
use orders
Even if this database does not yet exists, MongoDB can change to it. If we create a collection, users, etc. then this DB will get created.
Remember to get back to the library database by using:
use library
π¦ΈββοΈ Showing all Databasesβ
Extra activity, do it if you have extra time or are following at home, won't be covered during the hands-on Lab
You can also list other databases in your MongoDB instance with
show databases