0% found this document useful (0 votes)
10 views1 page

MongoDB Module5

The document is a question bank for a module on MongoDB and Node.js, covering topics such as CRUD operations, data modeling, and the use of Mongoose in MERN applications. It includes specific tasks like writing Mongo Shell commands, creating schemas, and implementing features in a web application. Additionally, it discusses core MongoDB components and provides examples of Node.js code for file reading and database connectivity.

Uploaded by

Jyothi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views1 page

MongoDB Module5

The document is a question bank for a module on MongoDB and Node.js, covering topics such as CRUD operations, data modeling, and the use of Mongoose in MERN applications. It includes specific tasks like writing Mongo Shell commands, creating schemas, and implementing features in a web application. Additionally, it discusses core MongoDB components and provides examples of Node.js code for file reading and database connectivity.

Uploaded by

Jyothi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Module 5 Question Bank

1. Discuss the key differences between insert, update and find operations in MongoDB. How does
MongoDB handle flexible schema and embedded documents?
2. Write Mongo Shell commands to perform following operations:
Insert 3 employee documents with different fields.
Update one document to add middle name
Delete one document by id
Create an index on the age field
Query employees whose age is greater than 30
3. Explain the core components of MongoDB: Document, Collection and Database
4. Write basic MongoDB queries for CRUD operations. What is CRUD operation in MongoDB?
5. How is data modelled in MongoDB? Demonstrate with a product schema
6. Discuss the role of Mongoose in MERN applications.
7. Write a [Link] program that reads a file using a callback and prints the content.
8. Discuss the key difference between insert, update and find operations in MongoDB. How does
MongoDB handle Flexible schema?
9. Illustrate the use of Event Emitter to trigger and listen to a custom event with an example.
10. Write [Link] code and MongoDB connectivity to create the “student” collection and then
inserts a document with fileds “name” and “srn” into the collection.
11. Suppose you are developing a web application for an online library management system.
Illustrate the role of each component(MERN) in implementing the feature where users can
search for books, view book details and place requests to borrow by providing code snippet.
12. With the code snippet explain the steps involved in writing/inserting data and reading data
into MongoDB.
13. Define a product schema using Mongoose. Insert data into the products collection using
Mongoose. Create an express API with a /products endpoint to fetch all products.

You might also like