Question: Access the dataset for this assignment, city _ inspections.json, in the / usr / local / datasets directory in your Apporto environment. Using the mongoimport

Access the dataset for this assignment, city_inspections.json, in the /usr/local/datasets directory in your Apporto environment. Using the mongoimport tool and documents found in the city_inspections.json file, load the database city into the inspections collection. Complete this task by typing the following commands in the Linux terminal to perform the import in the right directory:
Change into the Apporto directory with the data sets:
cd /usr/local/datasets/
Use the mongo import utility to load the data set:
mongoimport -username=${MONGO_USER}\
-password=${MONGO_PASS}-port=${MONGO_PORT}\
--host=${MONGO_HOST}-db city -collection inspections \
--authenticationDatabase admin -drop ./city_inspections.json
Tip: In any Linux systems, commands must be exact and use proper syntax and case sensitivity.
Verify your load by using the city database, and issuing the following queries in the mongo shell:
db.inspections.find({"id" : "10021-2015-ENFO"})
db.inspections.find({"result":"Out of Business"},{"business_name":1}).limit(10)
Provide screenshots of the results as evidence.
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.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!