About the course
MongoDB is a leading NoSQL document database, offering flexibility, scalability, and high performance for building modern applications that require handling diverse and evolving data structures. This comprehensive 2-day training course provides participants with a solid foundation in MongoDB, covering its core concepts, data modelling approach, and essential operations for managing data effectively. It is designed for developers, database administrators, data analysts, and other IT professionals looking to understand and work with document databases and leverage MongoDB's capabilities.
The course begins by exploring the landscape of NoSQL databases and understanding the advantages and characteristics of MongoDB's document model, including appropriate use cases. You will learn how to install MongoDB, connect using the MongoDB shell (mongosh), and work with the fundamental hierarchy of databases, collections, and documents. A significant portion of the course is dedicated to mastering Create, Read, Update, and Delete (CRUD) operations, progressing from simple commands to advanced querying techniques using the find command, understanding query operators, and exploring the implications of MongoDB's flexible schema. Practical skills for analysing and optimising query performance are developed through understanding indexing and using the explain() command.
Key features for data analysis and high availability are covered through exploring the powerful Aggregation Framework for performing complex data transformations and analysis pipelines directly within MongoDB, and understanding MongoDB Replica Sets for implementing automatic failover, ensuring data redundancy, and improving read scalability. The course integrates extensive hands-on labs throughout, allowing participants to gain practical experience with MongoDB installation, core CRUD operations, indexing, building aggregation pipelines, and interacting with replica sets, providing the practical skills needed to confidently work with MongoDB.
Instructor-led online and in-house face-to-face options are available - as part of a wider customised training programme, or as a standalone workshop, on-site at your offices or at one of many flexible meeting spaces in the UK and around the World.
-
- Understand NoSQL databases, the MongoDB document model, and appropriate use cases for MongoDB.
- Install and connect to MongoDB using Docker or native installers and effectively use the MongoDB shell (mongosh).
- Understand the structure and hierarchy of databases, collections, and documents in MongoDB.
- Perform basic and advanced Create, Read, Update, and Delete (CRUD) operations using the MongoDB shell, including querying with the find command and various operators.
- Understand MongoDB's flexible schema and its implications for data modelling and development.
- Use the explain() command and create indexes (single, compound) to analyse and improve query performance.
- Utilise the Aggregation Framework to perform data analysis and transformations using pipelines and common stages.
- Understand MongoDB Replica Sets for replication and high availability.
- Work with a local replica set, understanding concepts like automatic failover and read preferences.
-
This 2-day training course is designed for developers, database administrators, data analysts, and other IT professionals who need to learn how to work with MongoDB and understand its key features for modern data management. It is ideal for:
Developers building applications that require a flexible and scalable database.
Database Administrators managing or planning to manage MongoDB instances.
Data Analysts performing queries, aggregations, and analysis on data stored in MongoDB.
Anyone seeking a practical, hands-on introduction to MongoDB concepts and operations.
-
Participants should have:
Basic familiarity with database concepts (e.g., data storage, querying).
Basic computer literacy and experience using a command line or terminal interface.
No prior experience with NoSQL databases or MongoDB is required. We can customise the training to match your team's experience and needs - for instance, with more time and coverage of database fundamentals for new starters.
-
This MongoDB course is available for private / custom delivery for your team - as an in-house face-to-face workshop at your location of choice, or as online instructor-led training via MS Teams (or your own preferred platform).
Get in touch to find out how we can deliver tailored training which focuses on your project requirements and learning goals.
-
Introduction and Fundamentals
Introduction to NoSQL Databases and the Document Model: Understanding the landscape beyond relational databases and the key characteristics of document stores like MongoDB.
When to use MongoDB - and when not to: Exploring appropriate use cases and scenarios where MongoDB's flexible schema and scaling model are advantageous, contrasted with situations where other database types might be a better fit.
Thinking in Documents and Collections: Understanding the core data structures, how data is organised logically, and basic principles of data modelling in MongoDB.
Installation: Getting MongoDB set up and running. Installing and using MongoDB with Docker (our recommended method), with guidance for installing directly on Mac or Windows if preferred.
Connecting and exploring using the MongoDB Shell (mongosh): Getting started with the primary command-line interface for interacting with MongoDB.
Hands-On Lab: Installation of MongoDB (via Docker or natively), connecting to the MongoDB instance, exploring the mongosh interface and basic commands.
Database, Collections, and Basic CRUD Operations
Understanding the MongoDB hierarchy: Databases, Collections, and Documents – the logical structure for storing your data.
How data is constructed and structured within MongoDB documents (Introduction to BSON data types).
Creating a Database, a Collection, and inserting your first Document using the MongoDB Shell.
Simple CRUD examples (Create, Read, Update, and Delete) using basic commands in the MongoDB Shell.
Hands-On Lab: Creating databases and collections, inserting single and multiple documents, finding documents using basic queries, updating and deleting documents via the shell.
CRUD - A Deeper Dive and Querying
A look at MongoDB’s flexible schema: Understanding the implications and benefits of the dynamic schema on development and data structure.
Exploring the find command: Advanced querying techniques including query operators (comparison, logical, element, evaluation), projection (selecting fields), sorting results, limiting, and skipping results.
Insert vs Upsert: Understanding how to insert documents or atomically update existing ones if they match a query.
More on Update operations: Using update operators ($set, $inc, $push, etc.) for precise document modifications.
More on Delete operations: Deleting documents based on criteria.
Bulk operations: Performing multiple insert, update, and delete operations efficiently.
Looking at explain(): Understanding how to use the explain() command in the shell to analyse how MongoDB executes your queries and identify potential performance issues.
Atomicity of Writes: Briefly understand MongoDB's guarantees around document-level atomicity for single-document write operations.
Hands-On Lab: Practicing advanced querying with a variety of operators, performing complex updates and deletes, experimenting with bulk operations, using explain() to analyse query plans.
Indexing and Query Performance
The importance of Indexing in MongoDB: How indexes are structured and how they significantly improve query performance.
Understanding the Query Planner: How MongoDB evaluates available indexes and chooses the most efficient one for a given query.
Creating and using different Index Types: Single Field indexes and Compound (Multi-field) indexes.
Analysing Query Performance: Identifying slow queries using explain() and other techniques.
When and how to improve query performance using appropriate index strategies and optimising query patterns.
Hands-On Lab: Creating various types of indexes (single, compound), using explain() to compare query performance with and without indexes, optimising sample slow queries based on index analysis.
Aggregation Framework
Transforming and Analyzing Data: Introduction to the powerful Aggregation Framework for performing data transformations, aggregations, and analysis pipelines within MongoDB.
A look at Map-Reduce: Brief historical context on the Map-Reduce paradigm for aggregation before the modern Aggregation Framework (emphasise that the Aggregation Framework is the preferred and more performant approach today).
Understanding Aggregation Pipelines and Stages: How data flows through a sequence of operations.
Exploring common aggregation stages: $match (filtering), $group (grouping documents and performing aggregate functions like $sum, $avg), $project (reshaping documents), $sort (sorting results), $limit (limiting output size), $unwind (deconstructing arrays).
Building multi-stage aggregation pipelines to perform complex data analysis tasks.
Hands-On Lab: Writing and executing multi-stage aggregation pipelines using common stages to perform data analysis and transformation tasks on sample data.
Replication (Replica Sets)
Replication and redundancy: Understanding why database replication is crucial for high availability, fault tolerance, and data durability in production environments.
Introduction to MongoDB Replica Sets: The standard deployment architecture for production MongoDB.
Setting up a local Replica Set for testing and learning purposes (guided lab or demonstration).
When things go wrong: Understanding automatic failover and elections within a replica set.
Reading from secondary nodes for better read performance and scalability (Read Preferences).
Overview of the Oplog (Operations Log): How MongoDB tracks and replicates data changes between replica set members.
Data synchronisation and consistency concepts in a distributed replica set.
Hands-On Lab: Setting up and initialising a local replica set, performing basic operations (writes to primary, reads from secondaries), simulating member failure and observing the election process.
Summary and next steps
Review of key MongoDB concepts and features covered over the two days: Document Model, CRUD, Indexing, Aggregation, Replica Sets.
Discussing Best Practices for data modelling, querying, and deploying MongoDB.
Brief Introduction to Advanced MongoDB Topics (if time permits, based on the original outline):
Sharding: Concept for horizontal scaling across multiple machines.
Text Indexes and Searches.
Geospatial Indexes and Searches.
Next steps for continuing your MongoDB learning journey.
Q&A.
Optional Custom Course Topics for Java Developers:
These optional topics provide specific guidance for Java developers needing to connect to and interact with MongoDB from their Java applications. Including them in a custom course will extend the duration beyond 2 days and requires prior Java development experience.
Connecting and running CRUD queries with the Java API:
Setting up a Java project and adding the MongoDB Java driver dependency.
Connecting to a MongoDB instance from Java code.
Writing Create, Read, Update, and Delete operations using the Java driver API.
Understanding Codec and CodecRegistry for mapping Java objects to BSON documents and vice versa.
Introduction to integrating with Spring Boot + Embedded Mongo for writing unit and integration tests that use MongoDB in Java applications.
Hands-On Lab: Setting up a basic Java project with the MongoDB driver, writing and executing CRUD operations from Java code, exploring basic object mapping between Java objects and BSON documents.
-
MongoDB Documentation: The central hub for all MongoDB guides, tutorials, and reference materials. https://www.mongodb.com/docs/
MongoDB Shell (mongosh) Documentation: Official guide for using the primary command-line interface. https://www.mongodb.com/docs/mongodb-shell/
MongoDB CRUD Operations Documentation: Detailed guides on Create, Read, Update, and Delete operations. https://www.mongodb.com/docs/manual/crud/
MongoDB Indexing Documentation: Comprehensive information on creating and managing indexes for performance. https://www.mongodb.com/docs/manual/indexes/
MongoDB Aggregation Framework Documentation: In-depth guide to using the powerful aggregation pipelines. https://www.mongodb.com/docs/manual/aggregation/
Trusted by