M001: MongoDB Basics Chapter 2: The MongoDB Query Language + Atlas 课后习题答案

M001: MongoDB Basics Chapter 2: The MongoDB Query Language + Atlas 课后习题答案

Lab 2.0: Create an Atlas Sandbox Cluster (Ungraded)

Please note that, while we’ve labeled this as a lab, it is ungraded. This writeup is here simply to get you started on creating an Atlas cluster.

  1. Go to https://cloud.mongodb.com/links/registerForAtlas and complete the account creation form you see on that page. Please make sure you see the message “Sign up for MongoDB Atlas” at the top of the page.
    这里写图片描述
  2. Once you have completed the registration form, in the next page that appears, you will be asked to choose a new group name. We use groups to manage access to Atlas clusters. Please use the name, m001-sandbox.

提醒
2018-08-23 15:58:34
在 Atlas 里我们不需要再输入 group name,只需要点击 New Project 创建 project,然后创建 cluster 即可
这里写图片描述

  1. Once you have created a group, in the next page, enter the name, Sandbox for your cluster.
  2. On the same page, select the M0 instance size. Note that the “Pricing” now changes to say “$0.00/forever”. You do NOT need to enter a credit card to create a free-tier Atlas cluster (M0). They are free.
  3. Scroll to the bottom of the cluster-creation form and enter an administrative username and password. Please enter the username, m001-student and the password, m001-mongodb-basics.
  4. Once you’ve entered your username and password, click Confirm & Deploy. You will need to wait a few minutes for your cluster to be spun up.
  5. Once your cluster is ready, click on the Security tab and then on the IP Whitelist tab. Click the ADD IP ADDRESS button and, then, in the modal that pops up, click ALLOW ACCESS FROM ANYWHERE. Click the CONFIRM button and wait while the security settings for your cluster are configured.

Note that we do not generally recommend opening an Atlas cluster to allow access from anywhere. We do that for this class to minimize network issues that you might run into.

Lab 2.1: How Many Comedies?

Problem:

  1. If you have not already loaded the video.movieDetails collection, please review the lesson “Loading Data into Your Sandbox Cluster” for a tutorial. Then, use the script, loadMovieDetailsDataset.js, provided in the handouts for the lesson, “Connecting to an Atlas Cluster from the Mongo Shell” to load the movieDetails collection.
  2. Use Compass to connect to your sandbox cluster.
  3. In Compass, view the video.movieDetails collection and apply the filter { genres: “Comedy”}.

How many documents in video.movieDetails match the filter { genres: “Comedy”}?
Answer:
749
detailed answer:
If you have loaded the movieDetails collection, the filter { genres: “Comedy”} will match 749 documents.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

有一只海豚

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值