Interactive roadmap

    MongoDB roadmap

    Designed for developers wanting to work with NoSQL databases, this roadmap helps you store, query, and manage flexible data effectively.

    Your progress0% · 0 of 21 topics
    Done Learning Skipped OptionalClick any topic to learn more and mark your progress.
    1. 1

      Documents and Collections

      0 of 4 done

      Understand how MongoDB stores data using flexible JSON-like documents grouped into collections.

      Take your time exploring how MongoDB organises information; getting comfortable with documents early on makes everything else much easier.
    2. 2

      Basic CRUD Operations

      0 of 4 done

      Master the core commands needed to create, read, update, and delete your documents.

      Practice these four basic operations repeatedly until writing them feels completely natural for your daily coding tasks.
    3. 3

      Querying and Filtering

      0 of 4 done

      Write advanced search queries to filter, sort, and shape your results.

      Combine operators carefully to narrow down your search results and keep your app responses lightning fast.
    4. 4

      Data Modelling

      0 of 3 done

      Design efficient database structures by choosing between embedding and referencing related data.

      Think about how your application reads data before deciding your document structure to keep queries simple and fast.
    5. 5

      Aggregation and Indexes

      0 of 3 done

      Speed up searches with indexes and process complex data transformations using pipelines.

      Use indexes wisely to speed up searches, but do not create too many or updates will slow down.
    6. 6

      MongoDB Atlas

      0 of 3 done

      Deploy, manage, and scale your databases in the cloud using MongoDB Atlas.

      Always keep your connection strings secret and set up proper network access rules to keep your cloud database secure.

    Learn it all, with a tutor that never sleeps

    Every topic links to LevelUp lessons, practice exercises and the 24/7 AI Tutor. Your progress updates as you master lessons.

    Every topic explained

    Step 1: Documents and Collections

    Discover why NoSQL databases offer a flexible alternative to traditional tables and rows.
    Read more

    Traditional databases force your information into rigid rows and columns, which can slow you down when your data changes often. NoSQL databases like MongoDB throw out that strict rulebook. Instead, they let you store data in flexible, self-contained chunks that adapt as your application grows.

    Imagine building an online shop where some products have sizes and others have software license keys. In a rigid system, you would need empty columns for everything. In MongoDB, each product document simply holds the specific details it actually needs.

    This flexibility matters because it lets you build and update features faster without constantly redesigning database tables. It gives you room to experiment and change your mind as your project develops.

    • Stores data without rigid table structures
    • Allows different documents to have unique fields
    • Adapts easily as your project requirements change
    • Speeds up early stage feature development
    MongoDB Documentation
    Learn how JSON data is converted into binary BSON for efficient storage and querying.
    Read more

    MongoDB stores and moves information using a format that looks just like regular JavaScript Object Notation, which you might already know as JSON. It uses readable text brackets, keys, and values to represent your records clearly.

    Under the hood, MongoDB actually converts that readable text into BSON, which stands for Binary JSON. This clever binary format takes up less space and lets the computer read and search through your data much faster than standard text ever could.

    Understanding this conversion helps you know that while your code deals with familiar text structures, the database is quietly optimising everything for speed and storage efficiency behind the scenes.

    • Uses human readable JSON style syntax
    • Converts data to binary BSON for storage
    • Supports extra data types like dates and numbers
    • Optimises database performance and disk space
    Organise your data by grouping related documents together inside named collections.
    Read more

    When you start putting information into MongoDB, you need a way to keep things tidy. The database organizes your work into distinct databases, and inside each database, your documents live inside named groups called collections.

    Think of a database as a filing cabinet for a specific project, and collections as the individual folders inside it. For instance, your shop database might contain a collection for customers, another for products, and a third for orders.

    This grouping matters because it keeps related data together, making it simple to find what you need and preventing your application code from turning into a messy jumble of unrelated records.

    • Databases act as top level containers
    • Collections group related documents together
    • Collections hold multiple individual records
    • Keeps your project data neat and logical
    (optional)
    Explore your database visually using the official desktop application without writing code.
    Read more

    Writing code for every single database task can feel tedious when you just want a quick look at your data. MongoDB Compass is a free desktop application that gives your database a friendly graphical face, letting you click around instead of typing commands.

    Picture it like opening a file manager on your computer rather than using the command line. You can click on a collection, scroll through your documents, and even filter results using simple point and click menus.

    This tool is essential for beginners because it lets you see the direct results of your work immediately, helping you understand how your data looks without getting stuck on syntax errors.

    • Provides a visual desktop interface for MongoDB
    • Lets you browse collections without writing code
    • Includes handy visual query and filter builders
    • Helps you inspect document structures instantly

    Step 2: Basic CRUD Operations

    Add single or multiple records into your collections using simple commands.
    Read more

    Adding new information to your database is the first step in building any active application. In MongoDB, you insert records into collections as individual documents or as a batch of multiple items all at once.

    Imagine a library system where a staff member adds a brand new book into the catalogue. They hand over a card containing the title, author, and genre, and the system files it safely into the books collection.

    Mastering insertion is vital because it is how your app captures user inputs, signups, and purchases, turning fleeting actions into permanent records that your system can use later.

    • Adds new records into specified collections
    • Supports inserting single or multiple documents
    • Generates a unique id for every record
    • Captures app activity as permanent data
    Search through your collections to retrieve the exact records you need.
    Read more

    Once your data is safely stored, you need a reliable way to get it back out again. Finding documents involves searching through your collections using specific criteria to retrieve only the exact records you are looking for.

    Think of walking into a shoe shop and asking the assistant to show you all running trainers in size nine. The assistant checks the inventory and brings out just those matching boxes, ignoring everything else on the shelves.

    Knowing how to find documents efficiently ensures your application can display user profiles, search results, and settings quickly without making your users wait around.

    • Searches collections for matching records
    • Uses filter criteria to narrow down results
    • Can return single items or whole lists
    • Forms the backbone of app search features
    Modify existing data safely using operators that target specific fields.
    Read more

    Data rarely stays the same forever, so your database needs safe ways to modify existing records. Updating lets you change specific fields inside a document without accidentally wiping out everything else stored alongside it.

    Picture updating your delivery address in an online shopping profile. You change your street name and postcode, but your account history and payment preferences remain untouched and secure.

    This capability matters because your users expect to edit their profiles, change passwords, and update task statuses without losing their core account data.

    • Modifies existing records in your collections
    • Uses update operators to target specific fields
    • Leaves untouched fields safely intact
    • Keeps user and app information up to date
    Remove unwanted records from your collections when they are no longer required.
    Read more

    Sometimes information is no longer needed, whether due to privacy requests or old records expiring. Deleting documents allows you to permanently remove unwanted records from your collections.

    Imagine clearing out old, completed tasks from your daily to do list app so you only see what is relevant for today. You drop the finished items into the bin and they disappear from view.

    Knowing how to delete data properly helps you manage storage space and comply with data privacy regulations by ensuring user accounts can be completely removed when requested.

    • Permanently removes records from collections
    • Can target a single item or multiple matches
    • Helps manage database storage space
    • Supports privacy and account deletion rules

    Step 3: Querying and Filtering

    Filter records using greater than, less than, and equality checks.
    Read more

    Basic equality checks are useful, but real applications often need to compare values using greater than, less than, or not equal conditions. Comparison operators let you ask precise numerical or alphabetical questions of your data.

    Think of setting a price filter on a holiday booking website to find hotels that cost less than one hundred pounds per night. You are not looking for an exact match, but rather a range.

    These operators are essential for building dynamic user interfaces where people want to filter products by price ranges, dates, or ages.

    • Tests values using greater or less than
    • Checks for inequality and specific ranges
    • Works with numbers, dates, and text
    • Powers price and date range filters
    Combine multiple search conditions using and, or, and not logic.
    Read more

    When a single condition is not enough, logical operators let you chain multiple search rules together using and, or, and not logic to build sophisticated queries.

    Imagine searching for a flat to rent where the price must be under one thousand pounds and the location must be either central or near a park. You are combining multiple rules into one search.

    Mastering logical operators allows your app to handle complex user searches smoothly, making sure people can find exactly what they need even when their criteria have multiple moving parts.

    • Combines multiple conditions using and logic
    • Allows alternative matches using or logic
    • Reverses conditions using not rules
    • Handles complex multi-requirement user searches
    Search inside list fields to find specific items or match multiple values.
    Read more

    MongoDB lets you store lists of items, called arrays, directly inside your documents. Querying arrays allows you to search inside those list fields to find specific items or check if multiple values are present.

    Picture a recipe database where each recipe document contains an array of ingredients like flour, eggs, and sugar. You might want to find every recipe that includes chocolate.

    This skill is crucial because modern apps love storing tags, categories, and lists of items. Knowing how to query inside them lets you unlock deep insights from your nested data.

    • Searches inside list fields within documents
    • Finds documents containing specific array items
    • Checks for multiple matching elements
    • Manages tags, categories, and item lists
    (optional)
    Order your search results and restrict the number of returned documents.
    Read more

    Retrieving thousands of records at once will slow your app down and overwhelm your users. Sorting and limiting let you order your search results neatly and restrict the number of returned documents.

    Think of viewing a music streaming app chart page. The results are sorted by popularity from highest to lowest, and the screen only shows the top ten tracks at first.

    Using these tools keeps your application fast, efficient, and easy to read, giving users bite sized chunks of sorted data rather than a giant wall of unorganised text.

    • Orders results in ascending or descending sequence
    • Restricts the total number of returned documents
    • Improves application loading performance
    • Creates clear top lists and pagination views

    Step 4: Data Modelling

    Decide when to nest related data inside a single document versus linking separate documents.
    Read more

    One of the biggest design choices in MongoDB is deciding whether to put related information inside the same document or keep them separate and link them together. Embedding nests data inside a parent, while referencing keeps separate documents tied by an id.

    Imagine storing a user profile. You might embed their address directly inside the user document since it belongs only to them. However, you would reference their blog posts in a separate collection because they could grow infinitely.

    Choosing the right approach makes your queries simpler and ensures your database runs smoothly as your data volume expands.

    • Embedding nests related data in one document
    • Referencing links separate documents via ids
    • Depends on data growth and access patterns
    • Balances read speed with document size limits
    Model common app scenarios where a single parent relates to multiple child records.
    Read more

    Many common app scenarios involve a single parent record relating to multiple child items, such as an order containing several purchased products. Modelling this relationship correctly shapes your database success.

    Picture an online bookstore where a customer places an order containing three different books. You can embed those book items directly into the order document since they form a single transaction.

    Getting this design right prevents messy queries and ensures your app can fetch related information in a single, clean database request without unnecessary complexity.

    • Connects one parent to many child records
    • Can be modelled via embedding or referencing
    • Common in orders, posts, and category apps
    • Simplifies fetching related application data
    (optional)
    Enforce data quality rules on your flexible documents using validation rules.
    Read more

    While flexible data is fantastic, complete chaos can cause bugs in your application code. Schema validation lets you set rules and requirements on your collections so your flexible documents still follow core structure standards.

    Think of a form on a website that insists you fill in your email address and age before submitting. The form is flexible, but certain fields are mandatory for things to work.

    Applying validation rules gives you the best of both worlds, offering document flexibility while protecting your database from missing or incorrect data types.

    • Enforces rules on flexible document fields
    • Requires specific data types like strings or numbers
    • Prevents bad data from entering your collections
    • Combines flexibility with structural safety

    Step 5: Aggregation and Indexes

    Speed up read operations significantly by creating indexes on frequently searched fields.
    Read more

    Without an index, MongoDB has to scan every single document in a collection to find a match, which gets very slow as your data grows. Indexes create a sorted map of specific fields to speed up read operations significantly.

    Think of looking up a word in a dictionary. Instead of reading every page from the start, you jump straight to the alphabetical index and find your word in seconds.

    Creating indexes on fields you search frequently keeps your application feeling snappy and responsive, even when your database contains millions of records.

    • Speeds up read and search operations
    • Avoids scanning every document in a collection
    • Works like an alphabetical index in a book
    • Essential for performance with large datasets
    Process data through a series of stages to filter, group, and calculate statistics.
    Read more

    When you need to do more than just find records, the aggregation pipeline lets you process data through a series of step by step stages. You can filter, group, and calculate statistics in one fluid workflow.

    Imagine running a monthly sales report. Your pipeline filters for paid orders, groups them by product category, and calculates the total revenue for each group.

    This powerful tool turns raw database records into meaningful business insights, letting you handle complex data analysis directly inside MongoDB without writing heavy application code.

    • Processes data through sequential stages
    • Filters, groups, and calculates statistics
    • Turns raw records into useful reports
    • Handles complex analysis inside the database
    (optional)
    Perform multi-document operations safely with rollback support if errors occur.
    Read more

    Sometimes you need multiple write operations to succeed together as a single unit, or fail completely if something goes wrong. ACID transactions give you this all or nothing safety guarantee across documents.

    Picture transferring money from your savings account to your checking account. The system must subtract from savings and add to checking simultaneously; if one step fails, both must roll back.

    Using transactions protects your financial, booking, and inventory data from ending up in a half updated state when unexpected errors happen.

    • Ensures multi-document operations succeed together
    • Rolls back changes automatically if errors occur
    • Protects critical data like financial transfers
    • Maintains database consistency and reliability

    Step 6: MongoDB Atlas

    Set up a free cloud database cluster in just a few clicks.
    Read more

    Running a database on your own computer is great for practice, but real applications need a cloud home. MongoDB Atlas lets you spin up a free, fully managed cloud database cluster in just a few clicks.

    Think of moving your website files from your laptop onto a reliable web hosting provider so people around the world can access it twenty four hours a day.

    Creating a cloud cluster gets your project online quickly, taking care of server setup, backups, and maintenance so you can focus entirely on writing your app code.

    • Sets up a managed cloud database cluster
    • Removes the need for local server management
    • Provides free tier options for beginners
    • Keeps your project accessible from anywhere
    Connect your backend applications securely to your cloud database.
    Read more

    To let your backend application talk to your cloud database, you need a secure address link. A connection string is a special URL containing your credentials and cluster address that bridges your app to Atlas.

    Think of it like saving a secure Wi-Fi password and network name into your phone so it can connect automatically whenever you arrive home.

    Managing connection strings correctly is vital for linking your development and production environments while keeping your database login details safe from public view.

    • Links your backend app to the cloud database
    • Contains cluster address and credentials
    • Must be kept secret in environment variables
    • Enables smooth data communication
    (optional)
    Protect your data by setting up database users and network access rules.
    Read more

    Leaving your database open to the entire internet is a huge risk. Security basics involve creating dedicated database users with specific permissions and setting up network access rules to restrict connections.

    Picture locking the front door of your house and giving spare keys only to trusted family members rather than leaving the door wide open for strangers.

    Implementing these basic security steps protects your valuable user data from unauthorised access and keeps your cloud deployment safe from common online threats.

    • Creates dedicated users with limited permissions
    • Sets up network access IP whitelists
    • Protects cloud data from unauthorised access
    • Forms an essential part of deployment

    Related roadmaps