1. Introduction to MongoDB
Activity 1.01: Setting Up a Movies Database
Solution:
The following steps will help you complete this activity:
- First, connect to your MongoDB cluster that was set up as part of Exercise 1.04, Setting Up Your First Free MongoDB Cluster on Atlas. It should look something like this:
mongo "mongodb+srv://cluster0-zlury.mongodb.net/test" –username <yourUsername>
- Enter the preceding command on your command prompt and provide the password when prompted. Upon successful login, you should see a shell prompt with your cluster name, something like this:
MongoDB Enterprise Cluster0-shard-0:PRIMARY>
- Now, create the movies database and call it
moviesDB
. Utilize theuse
command:use moviesDB
- Create the
movies
collection with a few relevant attributes. Create the collection by inserting the documents into a non-existent collection. You are encouraged to think and implement collections with attributes that you...