0% found this document useful (0 votes)
141 views

Theory Questions: Finalexam. Write Down The Command That You Have Used Inside The Terminal To

The document contains theory and practical questions related to MongoDB. The theory questions cover benefits of NoSQL databases, CAP theorem and MongoDB, schema design using embedded and referenced data models, update operations in MongoDB, and indexing and replication. The practical questions involve importing data using mongoimport, querying the imported data based on fields, and counting results.

Uploaded by

mental12345
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
141 views

Theory Questions: Finalexam. Write Down The Command That You Have Used Inside The Terminal To

The document contains theory and practical questions related to MongoDB. The theory questions cover benefits of NoSQL databases, CAP theorem and MongoDB, schema design using embedded and referenced data models, update operations in MongoDB, and indexing and replication. The practical questions involve importing data using mongoimport, querying the imported data based on fields, and counting results.

Uploaded by

mental12345
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Theory Questions

1. Explain the benefits of NoSQL databases.


2. Explain CAP theorem and MongoDB as per CAP theorem.
3. Explain Schema Design and Modelling using Reference and Embedded Data models
along with examples.
4. Explain Update operations in MongoDB using $set, $unset, $inc, $push and
$addToSet.
5. Explain Indexing in MongoDB, types of Index and properties of index.
6. Explain Replication in MongoDB by talking about master-slave replication and
replica sets.

Practical:

1. Using mongoimport tool


a. Import people.json into a collection named people inside the database named
finalexam. Write down the command that you have used inside the terminal to
import. Also write down the number of documents imported.
b. Import restaurants.json into a collection named restaurants inside the
database named finalexam. Write down the command that you have used
inside the terminal to import. Also write down the number of documents
imported.
2. Use mongo shell to answer the question. Optionally you can use compass for help. In
the people collection,
a. Write a query to find the people whose first name is one of these 4 [
'Danielle', 'Stephen', 'Amy', 'Jason'] . You are expected to write a query that
looks like this db.collection.find(…) for this part of the question
b. What is the count of people from the above query. Write the query you have
used for getting the output.
3. Use mongo shell to answer the question. Optionally you can use compass for help. In
the people collection,
a. Write a query to find the people whose address has state as ’South Dakota'
and whose address has city as 'Port Margaret'. You are expected to write a
query that looks like this db.collection.find(…) for this part of the question
b. What is the count of people from the above query. Write the query you have
used for getting the output.

4. Use mongo shell to answer the question. Optionally you can use compass for help. In
the restaurants collection,
a. Write a query to find the restaurants whose star rating is greater than or equal
to 3.6 and less than 4.6 and whose cuisine is either of these 2 ['Indian',
'Italian’]. You are expected to write a query that looks like this
db.collection.find(…) for this part of the question
b. What is the count of people from the above query. Write the query you have
used for getting the output.

You might also like