subject

Overview To understand and make use of any database system, you must learn various techniques associated with the fundamental operations of create, read, update, and delete (CRUD). For this assignment, you will begin by creating databases of document collections and performing basic reading or querying operations to retrieve specific documents from the database system. You will also gain practice updating documents and subdocuments, and removing documents from a database. You will use the mongo shell and mongoimport commands to complete this assignment. Note: Since this is the only assignment for Module Two, it is longer than a typical assignment. Be sure to begin working on this early in the week.
Prompt
After completing the textbook reading and reviewing the mongoimport tool documentation in the module resources, complete the following tasks using the mongo shell in Apporto.
1. The data set for this assignment, city_inspections. json, has already been loaded into the Apporto environment for you. Using the mongoimport tool, load the database "city" with documents found in the city inspections. json file into the "inspections" collection. Complete this by typing the following commands in the Linux terminal to perform the import in the right directory:
cd /usr/local/datasets/ #change into the Apporto directory with the data sets mongoimport --db city --collection inspections ./city_inspections. json #mongo import utility
TIP: In any Linux systems, commands must be exact and use proper syntax and case sensitivity.
2. Verify your load by switching to the "city" database and issuing the following queries in the mongo shell:
a. db. inspections. find({"id" : "10021-2015-ENFO"})
b. db. inspections. find({"result": "Out of Business"}, {"business_name":1}). limit(10)
Provide screenshots of the results as evidence.
3. Using the appropriate commands in the mongo shell, insert a document to the database named "city" within the collection named "inspections." Use the following key-value pairs as data for your document.
Key Value
id "20032-2020-ACME"
certificate number 9998888
business name ACME Explosives"
date Today's date
result "Business Padlocked"
sector "Explosive Retail Dealer-999"
address number -> 1721
street-> Boom Road
city -> BRONX
zip -> 10463
Be sure the address is inserted as a sub-document, and use the JavaScript function Date() for "Today's date." Verify your database creation and insertion using the findOne() function in the mongo shell. Provide a screenshot as evidence.
4. Answer the following questions using MongoDB queries.
a. What is the distinct list of inspection "sector in the current inspections collection? How many are in the list? Do not count by hand.
b. What is the difference in the date data type for the business named "AUSTIN 2012" versus your business document insertion of "Acme Explosives"?
c. How many businesses have a "Violation Issued"? (See Value column above).
Verify by providing screenshots of the queries and results as evidence.
5. Using the appropriate command in the mongo shell, update the document with the ID "20032-2020-ACME" in the collection "inspections" in the database "city" with the information below.
Key Value
business_name "New ACME Flowers"
result "Business Re-opened"
comments "Flowers after the explosion"
Verify your database update using the appropriate find() function in the mongo shell. Provide a screenshot as evidence.
6. Using the database "City" with documents found in the "inspections" collection, perform the tasks listed below. Verify by providing screenshots of the results as evidence.
a. Update all the documents that contain the key-value pair "city": "ROSEDALE" in the address subdocument by changing the zip code in the address subdocument to "76114".
b. Remove the first document with the key-value pair "result":"Violation Issued."
Guidelines for Submission
Submit a Word document containing all of your screenshots. Use a screenshot tool, such as the Snipping Tool, for your screenshots and be sure to enlarge the images in the Word document before submitting. This will help make sure that your screenshots are an appropriate size for your instructor to be able to read them. Refer to this Use Snipping Tool to Capture Screenshots guide for help with taking screenshots.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 03:30
Many everyday occurrences can be represented as a binary bit. for example, a door is open or closed, the stove is on or off, and the fog is asleep or awake. could relationships be represented as a binary value? give example.
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
Before you record your own voice, you should a. record other people's voices b. warm up and practice difficult names c. listen to your favorite songs d. read a transcript of a good radio news segment
Answers: 1
question
Computers and Technology, 24.06.2019 00:20
Describe a data structures that supports the stack push and pop operations and a third operation findmin, which returns the smallest element in the data structure, all in o(1) worst-case time.
Answers: 2
question
Computers and Technology, 24.06.2019 14:40
Create a function (prob3_6) that will do the following: input a positive scalar integer x. if x is odd, multiply it by 3 and add 1. if the given x is even, divide it by 2. repeat this rule on the new value until you get 1, if ever. your program will output how many operations it had to perform to get to 1 and the largest number along the way. for example, start with the number 3: because 3 is odd, we multiply by 3 and add 1 giving us 10. 10 is even so we divide it by 2, giving us 5. 5 is odd so we multiply by 3 and add one, giving us 16. we divide 16 (even) by two giving 8. we divide 8 (even) by two giving 4. we divide 4 (even) by two giving 2. we divide 2 (even) by 2 to give us 1. once we have one, we stop. this example took seven operations to get to one. the largest number we had along the way was 16. every value of n that anyone has ever checked eventually leads to 1, but it is an open mathematical problem (known as the collatz conjectureopens in new tab) whether every value of n eventually leads to 1. your program should include a while loop and an if-statement.
Answers: 3
You know the right answer?
Overview To understand and make use of any database system, you must learn various techniques assoc...
Questions
question
Mathematics, 20.08.2019 12:00
question
Mathematics, 20.08.2019 12:00
question
History, 20.08.2019 12:00
question
English, 20.08.2019 12:00
Questions on the website: 13722363