Answered step by step
Verified Expert Solution
Question
1 Approved Answer
From the collection 'res Mongodb with restaurants database Make sure the restaurant database is imported into your MongoDB server. You can download it from here
From the collection 'res Mongodb with restaurants database
Make sure the restaurant database is imported into your MongoDB server.
You can download it from here restaurantsjson darr then import it to your server.
FYI, an example of a document in the restaurants dataset is as follows."address": "building":
"coord":
"street": "Morris Park Ave", "zipcode":
"borough": "Bronx",
"cuisine": "Bakery", "grades":
"date": $date": "grade": A "score":
"date": $date": "grade": A "score":
"date": $date": "grade": A "score":
"date": $date": "grade": A "score":
"date": $date": "grade": B "score":
"name": "Morris Park Bake Shop", "restaurantid:
ptseach From the collection 'res
queries.
For each of the following queries, show MongoDB MQL command and its results. For each query, show the first
documents only.
Run the commands using mongosh not MongoDB Compass You can check the results of commands using
MongoDB Compass, though.
Show the first restaurants which are in the borough of
Show the restaurants which do not serve any cuisine of 'Chinese' and received a grade point B The results
should be sorted based on cuisine in descending order.
Show the fields restaurantid name, cuisine, and borough, but don't include id for the first restaurants.
Show the next restaurants after skipping the first which are in the borough
Show the restaurants located in the borough of Manhattan and prepare either American or Chinese dishes.
Show the restaurants that achieved a score of more than but less than
Show the restaurantid name, borough, and cuisine for those restaurants that belong to the borough of
Staten Island or Queens or Bronx or Brooklyn.
Show the restaurantid name, borough, and cuisine for those restaurants that do not belong to the
borough of Staten Island or Queens or Bronx or Brooklyn. B MongoDB with your own table
create your database and collection
Create your own database and collection in MongoDB using MongoDB Compass or mongosh Use proper
name for database and collection.
choose ONE table from your term project MySQL database only one table with at least attributes If
your table has less than attributes, add mode attributes.
pts Show the contents of the original table in your MySQL table
Now in the table, assume you add a new attribute and fill the attribute with an array of numbers. For
example, in the figure below, you add a new attribute and fill the attribute with an array of values such as
Dont actually insert attributedata in your MySQL table. Actual insertions will be done in
steps If your table has less than records, add more records. Ensure the data values are diverse so
you can run queries in Q B
Represent the contents in Figure b in JSON format
Using MongoDB Compass, import the JSON file into your collection or you can manually insert documents
using insertManyslide
pts Show the contents of your collection using findptseach Execute ONE MQL command for each of the following Show a the query in plain English explain
what this query is about b the corresponding MQL command, and c the results of the command
use projection
use comparison operator
use $and and $or operator
use $all operator
use $elemMatch operator
queries.
For each of the following queries, show MongoDB MQL command and its results. For each query, show the first
documents only.
Run the commands using mongosh not MongoDB Compass You can check the results of commands using
MongoDB Compass, though.
Show the first restaurants which are in the borough of
Show the restaurants which do not serve any cuisine of 'Chinese' and received a grade point B The results
should be sorted based on cuisine in descending order.
Show the fields restaurantid name, cuisine, and borough, but don't include id for the first restaurants.
Show the next restaurants after skipping the first which are in the borough
Show the restaurants located in the borough of Manhattan and prepare either American or Chinese dishes.
Show the restaurants that achieved a score of more than but less than
Show the restaurantid name, borough, and cuisine for those restaurants that belong to the borough of
Staten Island or Queens or Bronx or Brooklyn.
Show the restaurantid name, borough, and cuisine for those restaurants that do not belong to the
borough of Staten Island or Queens or Bronx or Brooklyn.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started