Connecting to MongoDB in Python

Learn about the Python driver for MongoDB and how to use it to connect to your Python applications.

Connecting to MongoDB in Python

Unit Overview

In this unit, you'll learn how to connect a Python application to a MongoDB Atlas cluster by using PyMongo, the official MongoDB driver for synchronous Python applications. First, you'll learn what MongoDB drivers are and how they’re used to connect applications to MongoDB. Next, you'll install PyMongo by using the pip package installer and explore best practices when creating a MongoClient instance. Finally, you'll learn how to troubleshoot some common connection and authentication issues.

Prerequisite

Lessons in This Unit

  • Lesson 01: Using MongoDB Python Client Libraries
  • Lesson 02: Connecting to an Atlas Cluster in Python Applications
  • Lesson 03: Troubleshooting a MongoDB Connection in Python Applications
  • 01.
    Lesson 1: Using MongoDB Python Client Libraries
    • Learn
    • Practice
  • 02.
    Lesson 2: Connecting to an Atlas Cluster in Python Applications
    • Learn
    • Practice
  • 03.
    Lesson 3: Troubleshooting a MongoDB Connection in Python Applications
    • Learn
    • Practice
  • 04.
    Conclusion
    • Learn
Julianna Chen I Senior Curriculum Engineer

Julianna Chen I Senior Curriculum Engineer

Julianna is a Senior Curriculum Engineer on the Education team, based in Vancouver, Canada. She’s developed educational content at universities and non-profits for over ten years, and is passionate about supporting access to quality technical education worldwide.

Emily Pope | Senior Curriculum Designer

Emily Pope | Senior Curriculum Designer

Emily is a Senior Curriculum Designer at MongoDB. Prior to MongoDB, Emily worked closely with professors at MIT and Columbia to design bootcamps in full stack development and data science at Emeritus. She also worked as an instructional designer on database and computer science learning experiences at Cengage. Emily loves learning about the everchanging tech space and is passionate about making these skills accessible to a global audience.

NS
October 23, 2023 7:12 PM


AK
October 23, 2023 2:56 PM


GJ
October 20, 2023 2:03 PM

Good

SS
October 20, 2023 8:27 AM

very good experience

VS
October 20, 2023 6:12 AM


SR
October 19, 2023 4:28 AM

awesome

AA
October 18, 2023 9:17 AM

Nice experience

CO
October 17, 2023 11:48 AM

The practice was nice.