Prompt After completing the textbook reading and reviewing the mongoimport tool documentation in the module resources, c
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Prompt After completing the textbook reading and reviewing the mongoimport tool documentation in the module resources, c
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. Value Key id certificate_number business_name date result sector address "20032-2020-ACME" Key 9998888 business_name "ACME Explosives" result Today's date 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. comments "Business Padlocked" 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"? "Explosive Retail Dealer-999" c. How many businesses have a "Violation Issued"? (See Value column above.) Verify by providing screenshots of the queries and results as evidence. number -> 1721 street-> Boom Road city-> BRONX zip -> 10463 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. Value "New ACME Flowers" "Business Re-opened" "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."