MongoDB
Semester 4. Course Code: BDSL456B
CIE Marks 50. SEE Marks: 50
Teaching Hours/Week (L: T:P: S) 0:0:2:0
Total Hours of Pedagogy 24 Credits 01
Total Marks 100
‐----------------‐------------------------------------------------------------------------------------
Course objectives:
1. Understand basic MongoDB functions, operators and types of operations in
MongoDB.
2. Demonstrate the use of Indexing, Advanced Indexing in MongoDB.
3. Apply the aggregation and Map Reduction in MongoDB.
4. Demonstrate text searching on collections in MongoDB. Sl.NO Experiments
Experiments
1 a. Illustration of Where Clause, AND,OR operations in MongoDB.
b. Execute the Commands of MongoDB and operations in MongoDB : Insert, Query,
Update, Delete and Projection. (Note: use any collection)
[Refer: Book 1 chapter 4].
2 a. Develop a MongoDB query to select certain fields and ignore some fields of the
documents from any collection.
b. Develop a MongoDB query to display the first 5 documents from the results obtained
in a. [use of limit and find]
[Refer: Book1 Chapter 4, book 2: chapter 5]
3 a. Execute query selectors (comparison selectors, logical selectors ) and list out the
results on any collection
b. Execute query selectors (Geospatial selectors, Bitwise selectors ) and list out the
results on any collection
[Refer: Book 3 Chapter 13]
4 Create and demonstrate how projection operators ($, $elematch and $slice) would be
used in the MongoDB.
[Refer: Book 3 Chapter 14]
5 Execute Aggregation operations ($avg, $min,$max, $push, $addToSet etc.). students
encourage to execute several queries to demonstrate various aggregation operators)
[Refer: Book 3 Chapter 15] 6 Execute Aggregation Pipeline and its operations (pipeline
must contain $match, $group, $sort, $project, $skip etc. students encourage to execute
several queries to demonstrate various aggregation operators) [refer book 2: chapter 6 ]
7 a. Find all listings with listing_url, name, address, host_picture_url in the listings And
Reviews collection that have a host with a picture url
b. Using E-commerce collection write a query to display reviews summary. [refer
Book2: chapter 6]
8 a. Demonstrate creation of different types of indexes on collection (unique, sparse,
compound and multikey indexes)
b. Demonstrate optimization of queries using indexes.
[Refer: Book 2: Chapter 8 and Book 3: Chapter 12]
9 a. Develop a query to demonstrate Text search using catalog data collection for a
given word b. Develop queries to illustrate excluding documents with certain words and
phrases [Refer: Book 2: Chapter 9]
10 Develop an aggregation pipeline to illustrate Text search on Catalog data collection.
Refer: Book 2 :Chapter 9]
Course outcomes (Course Skill Set):
At the end of the course the student will be able to:
1. Make use of MangoDB commands and queries.
2. Illustrate the role of aggregate pipelines to extract data.
3. Demonstrate optimization of queries by creating indexes.
4. Develop aggregate pipelines for text search in collections.
Suggested Learning Resources:
BOOK 1: “MongoDB: The Definitive Guide”, Kristina chodorow, 2 nd ed O’REILLY, 2013.
BOOK 2: “MongoDB in Action” by KYLE BANKER et. Al. 2 nd ed, Manning publication, 2016
BOOK 3: “MongoDB Complete Guide” by Manu Sharma 1 st ed, bpb publication, 2023.
Installation of MongoDB Video: https://www.youtube.com/watch?v=dEm2AS5amyA
Video on Aggregation: https://www.youtube.com/watch?v=vx1C8EyTa7Y
MongoDB in action book Code download URL:
https://www.manning.com/downloads/529 ●
MongoDB Exercise URL: https://www.w3resource.com/mongodb-exercises/