Please Help!
Create a database named “city” with a document composed of the key-value pairs listed below in a collection named “inspections.”
Key |
Value |
id |
“20032-2017-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 |
Answer the following questions using MongoDB queries:
a. What is the distinct list of inspection results in the current inspections collection? How many are in the list? Use JavaScript code to find the answer.
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 been “padlocked”? (See Value column above.)
Database creation
:Users\hp mongo ongoDB shell version: 3.2.28-12-g3a21ece196 onnecting to: test erver has startup warnings: 018-89-17Te2:50:50.629+0530 I CONTROL [initandlisten] 018-89-17Te2:5e:50.630+0530 I CONTROL [initandlistenWARNING: This 32-bit MongoDB binary is deprecated 018-89-17Te2:5e:50.630+0530 I CONTROL [initandlistenNOTE: This is a 32-bit MongoDB binary running on a 64-bit operating 018-89-17Te2:5e:50.630+0530 I CONTROL [initandlisten]** 018-89-17T02:58:50.638+8530 I CONTROL [initandlisten]* 018-89-17T02:58:50.638+8530 I CONTROL [initandlisten] 018-89-17T02:5:50.630+8530 I CONTROL [initandlisten] 018-09-17Te2:58:50.63e+0530 I CONTROL [initandlisten]NOTE: This is a 32 bit MongoDB binary 018-89-17Te2:5:50.631+0530 I CONTROL [initandlisten]** 018-89-17T02:50:50.631+0530 I CONTROL [initandlisten]* 018-89-17T02:50:50.632+0530 I CONTROL [initandlisten]* 018-09-17Te2:50:50.632+8530 I CONTROL [initandlisten] system. Switch to a 64-bit build of MongoDB to support larger databases. 32 bit builds are limited to less than 2GB of data (or less with --journal) Note that journaling defaults to off for 32 bit and is currently off See http://dochub.mongodb.org/core/32bit use city witched to db city db itycreating collection inspections and inserting document shown below
verifying inserted document using findOne() shown below
Please Help! Create a database named “city” with a document composed of the key-value pairs listed...