From the course: MongoDB Python Developer Associate Cert Prep

Unlock this course with a free trial

Join today to access over 24,500 courses taught by industry experts.

Connecting to MongoDB in Python review

Connecting to MongoDB in Python review

- In this unit, you learned what a MongoDB driver is and how to connect a Python application to a MongoDB Atlas cluster by using PyMongo. You also learned how to resolve common connection errors. When we build a Python application that connects to MongoDB, the application requires a set of libraries to interact with our MongoDB instance. These libraries are referred to as drivers. Drivers are the middleware between your application and your database. PyMongo is the official MongoDB driver for synchronous Python applications. Before we connected our application to our Atlas cluster, we first had to install PyMongo by using PIP, the package installer for Python. After installing the driver, we used our Atlas connection string to create a connection between our application and database. We learned the importance of using a single Mongo client instance for the life of the application to be reused across all database requests.…

Contents