M001: MongoDB Basics Chapter 1: Introduction

M001: MongoDB Basics Chapter 1: Introduction

M001: MongoDB Basics Chapter 1: Introduction 課後習題答案

Lab 1.1: Install Compass and Connect

Problem: 
If you have not yet downloaded Compass, please follow these instructions. Then answer the question below.

  1. Please download Compass from the MongoDB Download Center.
  2. Install Compass on your computer from the download.
  3. Launch Compass.
compass_connect_screen

When Compass opens you will see a page titled “Connect to Host”. 

4. Use the following information to complete this form, but do not click “Connect” yet. Hostname is cluster0-shard-00-00-jxeqq.mongodb.net. Username is m001-student. Password is m001-mongodb-basics
5. Click “Add to Favorites” so that you can easily connect to our class MongoDB deployment after closing and restarting Compass at some point in the future. 
6. Now, click “Connect” and load the databases in the M001 class MongoDB deployment.

Question Which of the following field names appear in documents in the movies collection of the video database. Check all that apply.

_id, cast, director, genre, plot

Answer: 

detailed answer: 
In Compass, navigate to the schema view for the movies collection of the video database. Fields are listed in alphabetical order in the schema view and all fields found in the collection are listed in this view. Scroll through the schema view to check each choice to see whether it is present in documents in this collection.

Lab 1.2: Determine the Value Type, Part 1

date
100yweather_ts_value_type

Problem: 
What is the value type of the ts field for documents in the 100YWeatherSmall.data collection? 
Answer: 

detailed answer: 
In Compass, navigate to the schema view for the data collection of the 100YWeatherSmall database. Scroll through the schema view to find the ts field. The value type is described immediately below the field name. You should see the following for this field in the Compass schema view. Note that date is listed as the value type for ts

Lab 1.3: Determine the Value Type, Part 2

document
100yweather_airtemperature_value_type

Problem: 
What is the value type of the airTemperature field for documents in the 100YWeatherSmall.data collection? 
Answer: 

detailed answer: 
In Compass, navigate to the schema view for the data collection of the 100YWeatherSmall database. Scroll through the schema view to find the airTemperature field. The value type is described immediately below the field name. You should see the following for this field in the Compass schema view. Note that document is listed as the value type for airTemperature

Lab 1.4: Determine the Value Type, Part 3

int32

Problem: 
What is the value type of the year field for documents in the video.movies collection? 
Answer: 

detailed answer: 
In Compass, navigate to the schema view for the movies collection of the video database. Scroll through the schema view to find the year field. The value type is described immediately below the field name. You should see the following for this field in the Compass schema view. Note that int32 is listed as the value type for year.

Lab 1.5: Scavenger Hunt, Part 1

6

Problem: 
How many movies in the video collection were directed by Patty Jenkins. Stated more precisely, how many documents in the video.movies collection have a value of “Patty Jenkins” for the director field? 
Answer: 

detailed answer: 
In Compass, navigate to either the schema view or the documents view for the movies collection of the video database. To get the correct answer, you need to enter the following query in the filter form field:

{“director”: “Patty Jenkins”}

Lab 1.6: Scavenger Hunt, Part 2

754

Problem: 
How many documents in the citibike.trips collection have a tripduration that is greater than or equal to 60 and less than 65? 
Answer: 

detailed answer: 
In Compass, navigate to either the schema view or the documents view for the citibike.trips collection. To get the correct answer, you need to enter the following query in the filter form field:

{“tripduration”: {“gte”:60,”gte”:60,” lt”: 65}}

Lab 1.7: Scavenger Hunt, Part 3

0-10
cancun_shipwrecks

Problem: 
Based on our shipwrecks dataset, how many shipwrecks lay off the coast of Cancun, Mexico? Choose the answer that best describes the number of shipwrecks you are able to find using Compass. 
Answer: 

detailed answer: 
In Compass, navigate to either the schema view or the documents view for the ships.shipwrecks collection. To get the correct answer, locate Cancun, Mexico on the map for the coordinates field. Click on the name, “Cancun” on the map, press the shift key on your keyboard and drag your mouse to a radius that encompasses the coast of Cancun. Click the “APPLY” button near the filter form field. I found three shipwrecks. 

Share this post

Comments (3)

  • Josephhix Reply

    Bounce rate.
    Network traffic to boost ranks and exposure.

    NEW! Now you can choose the Country you want the traffic to come from, as well.

    Supercharge Your SEO And Boost Your Alexa Ranking with 1 Million unique Visitors Traffic sent Within 1 Month. Available only Here. Cheapest Offer On the Internet And Exclusively Available on Monkey Digital

    Read More details about our great offer:
    https://monkeydigital.co/product/network-traffic-offer/

    Thanks and regards
    Mike
    Monkey Digital
    monkeydigital.co@gmail.com

    September 4, 2019 at 2:31 am
  • Alizbeth r Reply

    thanks for answering M001 questions

    August 16, 2019 at 2:16 am
  • hamna Reply

    nice

    August 16, 2019 at 2:15 am

Leave a Reply

Your email address will not be published. Required fields are marked *