Skip to main content

Introduction to MongoDB in Python

Learn to manipulate and analyze flexibly structured data with MongoDB.

Start Course for Free
4 Hours16 Videos60 Exercises14,256 Learners4450 XPData Engineer Track

Create Your Free Account



By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA. You confirm you are at least 16 years old (13 if you are an authorized Classrooms user).

Loved by learners at thousands of companies

Course Description

MongoDB is a tool to explore data structured as you see fit. As a NoSQL database, it doesn't follow the strict relational format imposed by SQL. By providing capabilities that typically require adding layers to SQL, it collapses complexity. With dynamic schema, you can handle vastly different data together and consolidate analytics. The flexibility of MongoDB empowers you to keep improving and fix issues as your requirements evolve. In this course, you will learn the MongoDB language and apply it to search and analytics. Working with unprocessed data from the official API, you will explore and answer questions about Nobel Laureates and prizes.

  1. 1

    Flexibly Structured Data


    This chapter is about getting a bird's-eye view of the Nobel Prize data's structure. You will relate MongoDB documents, collections, and databases to JSON and Python types. You'll then use filters, operators, and dot notation to explore substructure.

    Play Chapter Now
    Intro to MongoDB and the Nobel Prize dataset
    50 xp
    Count documents in a collection
    50 xp
    Listing databases and collections
    100 xp
    List fields of a document
    100 xp
    Finding documents
    50 xp
    "born" approximation
    50 xp
    Composing filters
    100 xp
    We've got options
    100 xp
    Dot notation: reach into substructure
    50 xp
    Choosing tools
    50 xp
    Starting our ascent
    100 xp
    Our 'born' approximation, and a special laureate
    100 xp
  2. 3

    Get Only What You Need, and Fast

    You can now query collections with ease and collect documents to examine and analyze with Python. But this process is sometimes slow and onerous for large collections and documents. This chapter is about various ways to speed up and simplify that process.

    Play Chapter Now
  3. 4

    Aggregation Pipelines: Let the Server Do It For You

    You've used projection, sorting, indexing, and limits to speed up data fetching. But there are still annoying performance bottlenecks in your analysis pipelines. You still need to fetch a ton of data. Thus, network bandwidth and downstream processing and memory capacity still impact performance. This chapter is about using MongoDB to perform aggregations for you on the server.

    Play Chapter Now

In the following tracks

Data Engineer


alexandrayaroshAlex Yaroshgreg48f6413b062b43d9922770f18691b376Greg Wilsonhadrien-d4e73b49-bc29-46b7-a485-2f598f38e3b9Hadrien Lacroixmari-07494695-96a1-4a02-800a-956e6fd8c0caMari Nazary
Donny Winston Headshot

Donny Winston

Donny is a computer systems engineer at Lawrence Berkeley National Lab.

Donny is a computer systems engineer at Lawrence Berkeley National Lab. He is the principal web developer for the Materials Project (, and he co-maintains several codebases and services for data-driven discovery of advanced materials. MongoDB helps him support rapid collaboration and schema evolution for these services. An instructor for the Software Carpentry Foundation, he has taught workshop lessons on Python, Git, Bash, SQL, and MongoDB. In the past, he studied nano-fabrication and scanning-charged-particle-beam lithography before shifting professional focus to software-as-a-service. He likes hyphens.
See More

What do other learners have to say?

I've used other sites—Coursera, Udacity, things like that—but DataCamp's been the one that I've stuck with.

Devon Edwards Joseph
Lloyds Banking Group

DataCamp is the top resource I recommend for learning data science.

Louis Maiden
Harvard Business School

DataCamp is by far my favorite website to learn from.

Ronald Bowers
Decision Science Analytics, USAA