Coding Exercises: MongoDB
1h 45mIntermediate2022-11-18
Authors
John Cokos
Director of Curriculum at Code Fellows
Course details
Hone your skills in the core concepts of working with a MongoDB database in this course with instructor John Cokos. John delves into the CRUD operations—create, read, update, delete—with MongoDB databases. He presents challenges to teach you how to create a database, document schemas, and validation rules, as well as adding documents in those collections manually and through importing and exporting. John then delves into the many ways to query MongoDB databases using JavaScript in MongoShell, Compass, and advanced filtering and aggregations. The challenge series finishes up with some exercises related to updating and deleting documents and collections.
Skills covered
MongoDBDatabase DevelopmentDatabase ManagementOpen SourceSoftware DevelopmentOne-Off
Concepts
0. Introduction
- 01 - Introduction, goals, and prerequisites
- 02 - Tooling - mongosh and Compass install, configure, and basic use
1. CRUD - Create (Insert) Documents
- 03 - Create - Complex schema (array, object, reference, and constraints)
- 04 - Create - Insert a record into the document
- 05 - Create - Insert multiple records with one statement
- 06 - Create - Insert multiple records using a loop (seeding)
- 07 - Create - Insert multiple records from a file
2. CRUD - Read (Query Find) Documents
- 08 - Find - Query with a simple filter
- 09 - Find - Specify which fields to return in a .find()
- 10 - Find - Sorting and limiting
- 11 - Find - Query operators - $gte, $in - , etc
- 12 - Find - Values in sub-documents and objects
- 13 - Find - Values in arrays
- 14 - Find - $and and $or queries
- 15 - Find - Custom query logic with functions
3. CRUD - Update Documents
- 16 - Update - Use a filter to update one or more records
- 17 - Update - Add an element to an array in a document
4. CRUD - Delete Documents
- 18 - Delete - Remove an element in an array within a document
- 19 - Delete - Multiple records
Conclusion
- 20 - Next steps