Subject Name Database Development 2_MongoDB
Practical Project Mock Test 1
Week 1
Question 1
1. What are the advantages of MongoDB?
2. What is a Document in MongoDB?
3. What is a Collection in MongoDB?
4. What are Databases in MongoDB?
5. What is the Mongo Shell?
Question 2
1. Write a MongoDB query to display all the documents in the collection restaurants.
2. Write a MongoDB query to display the fields, restaurant_id, name, borough, and zip code, but
exclude the field _id for all the documents in the collection restaurant.
3. Write a MongoDB query to find the restaurants which do not prepare any cuisine of
'American' and achieved a score of more than 70 and located in the longitude less than -
65.754168.
Note: Do this query without using $and operator
4. Write a MongoDB query to find the restaurant Id, name, borough, and cuisine for those
restaurants which contain 'ces' as the last three letters for its name.
5. Write a MongoDB query to display all the restaurants which are in the borough Bronx.
Week 2
1. Write a MongoDB query to display the first 5 restaurants which are in the borough Bronx.
2. Write a MongoDB query to display the next 5 restaurants after skipping the first 5 which are in
the borough Bronx.
3. Write a MongoDB query to find the restaurants that achieved a score of more than 90.
4. Write a MongoDB query to find the restaurants that achieved a score, of more than 80 but
less than 100.
5. Write a MongoDB query to find the restaurants which locate in latitude values less than -
95.754168.
Page 1 of 3
Academic Institute of Excellence Pty Ltd, DHET Reg: 2018/FE07/003
6. Write a MongoDB query to find the restaurants that do not prepare any cuisine of 'American'
and their grade score more than 70 and latitude less than -65.754168.
7. Write a MongoDB query to find the restaurants which do not prepare any cuisine of
'American' and achieved a score of more than 70 and located in the longitude less than -
65.754168.
Note: Do this query without using $and operator.
8. Write a MongoDB query to find the restaurants which do not prepare any cuisine of
'American ' and achieved a grade point 'A' not belonging to the borough Brooklyn. The
document must be displayed according to the cuisine in descending order.
Week 3
1. Write a MongoDB query to find the restaurant Id, name, borough, and cuisine for those
restaurants which contain 'Reg' as three letters somewhere in their name.
2. Write a MongoDB query to find the restaurants which belong to the borough Bronx and
prepared either American or Chinese dishes.
3. Write a MongoDB query to find the restaurant Id, name, borough, and cuisine for those
restaurants which belong to the borough of Staten Island or Queens or Bronx or Brooklyn.
4. Write a MongoDB query to find the restaurant Id, name, borough, and cuisine for those
restaurants which do not belong to the borough Staten Island or Queens or Bronx, or
Brooklyn.
5. Write a MongoDB query to find the restaurant Id, name, borough and cuisine for those
restaurants which achieved a score that is not more than 10.
6. Write a MongoDB query to find the restaurant Id, name, borough and cuisine for those
restaurants which prepared dishes except 'American' and 'Chinees' or the restaurant's name
begins with the letter 'Wil'.
7. Write a MongoDB query to find the restaurant Id, name, and grades for those restaurants
which achieved a grade of "A" and scored 11 on an ISODate "2014-08-11T00:00:00Z" among
many survey dates..
8. Write a MongoDB query to find the restaurant Id, name and grades for those restaurants
where the 2nd element of the grades array contains a grade of "A" and score 9 on an
ISODate "2014-08-11T00:00:00Z".
9. Write a MongoDB query to find the restaurant Id, name, address, and geographical location
for those restaurants where the 2nd element of the coord array contains a value that is more
than 42 and up to 52..
10. Write a MongoDB query to arrange the name of the restaurants in ascending order along
with all the columns.
Page 2 of 3
Academic Institute of Excellence Pty Ltd, DHET Reg: 2018/FE07/003
11. Write a MongoDB query to arrange the name of the restaurants in descending along with all
the columns.
12. Write a MongoDB query to arranged the name of the cuisine in ascending order and for that
same cuisine borough should be in descending order.
13. Write a MongoDB query to know whether all the addresses contain the street or not.
14. Write a MongoDB query that will select all documents in the restaurant’s collection where the
coord field value is Double.
15. Write a MongoDB query that will select the restaurant Id, name, and grades for those
restaurants which return 0 as a remainder after dividing the score by 7.
16. Write a MongoDB query to find the restaurant name, borough, longitude, and attitude and
cuisine for those restaurants which contains 'mon' as three letters somewhere in its name.
Page 3 of 3
Academic Institute of Excellence Pty Ltd, DHET Reg: 2018/FE07/003