Video Transcript (English)
Hello! In this video, you’ll learn what database drivers are and how MongoDB drivers are used to connect Python applications to MongoDB databases.
When you build a Python application that connects to MongoDB, the application requires a set of libraries to interact with your MongoDB deployment.
Collectively, these libraries are referred to as drivers.
Drivers are the middleware between your application and your database.
MongoDB maintains two official Python drivers: PyMongo, for use in synchronous Python applications and Motor, for use in asynchronous Python applications.
In this video, we’ll use PyMongo, the official MongoDB driver for synchronous applications.
MongoDB drivers simplify connecting to and interacting with your database from an application.
The official MongoDB drivers establish secure connections to a MongoDB cluster and execute database operations on behalf of client applications.
Additionally, drivers allow you to specify connection options. These might include security settings, write durability, read isolation, and much more.
The official MongoDB drivers adhere to each programming language’s best practices. They allow full use of your MongoDB deployment’s functionality and make upgrading easier.
This is harder to do with a non-official driver or an Object-Document Mapper, otherwise known as an ODM.
You can learn more about PyMongo in the documentation, which you can find on the official MongoDB driver documentation website.
There you’ll find information to get you started with PyMongo, including usage examples, driver fundamentals, API documentation, and references.
Great!
You now know the role that the official MongoDB Python drivers play in your Python applications.
Let’s go over the key points covered in this video:
MongoDB Python applications must use the official drivers to ensure optimal performance and easy upgrading.
Drivers simplify connecting to and interacting with a MongoDB database.
PyMongo is the official MongoDB driver for synchronous Python applications.
And official driver documentation is available on the MongoDB website.