Question

Please Help! Create a database named “city” with a document composed of the key-value pairs listed...

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
zip -> 10463

  1. 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.)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

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

Add a comment
Know the answer?
Add Answer to:
Please Help! Create a database named “city” with a document composed of the key-value pairs listed...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT