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

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 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.