Skip to content

Latest commit

 

History

History
64 lines (53 loc) · 3.73 KB

README.md

File metadata and controls

64 lines (53 loc) · 3.73 KB

Homeworkds Week 01 - INTRODUCTION


  • Homework 01

Install MongoDB on your computer and run it on the standard port.

Download the HW1-1 from the Download Handout link and uncompress it.

Use mongorestore to restore the dump into your running mongod. Do this by opening a terminal window (mac) or cmd window (windows) and navigating to the directory so that you are in the parent directory of the dump directory (if you used the default extraction method, it should be hw1/).

Now type: mongorestore dump

Note you will need to have your path setup correctly to find mongorestore.

Next, go into the Mongo shell, perform a findOne on the collection called hw1 in the database m101. That will return one document. Please provide the value corresponding to the "answer" key from the document returned.

R:
	42
  • Homework 02

Which of the following are valid JSON documents? Please choose all that apply.
R:
		{ "name" : "Fred Flinstone" ; "occupation": "Miner" ; "wife" : "Wilma" }
		{ "city" = "New York", "population" = 7999034, "boroughs" = ["queens", "manhattan", "staten island", "the bronx", "brooklyn"] }
	√   { "title" : "Star Wars", "quotes" : [ "Use the Force", "These are not the droids you are looking for" ], "director" : "George Lucas" }
	√   { "a" : 1, "b" : { "b" : 1, "c" : "foo", "d" : "bar", "e" : [1, 2, 4] } }
	√   {}

Go back to homepage