Lesson 1: Using the MongoDB PHP Driver / Learn

Press O for more options
2:17

Video Transcript (English)

Hello! In this video, you’ll learn what drivers are and how they enable you to work with MongoDB. You'll also be introduced to the MongoDB PHP driver, which consists of two components: an extension and a library.

MongoDB drivers simplify connecting to and interacting with your database from an application.

The official MongoDB driver establishes secure connections to a MongoDB cluster and executes 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 you to use all the functionality of your MongoDB deployment and make upgrading easier.

When you build a PHP application that connects to MongoDB, the application uses a client library, known as a driver, to interact with your deployment.

The MongoDB PHP driver consists of the following two components: an extension and a library.

The extension provides a low-level API and consists of core classes, such as the MongoDB\Driver\Manager.

The library provides a full-featured API for working with MongoDB databases that’s consistent with other MongoDB language drivers by modeling client, database, and collection objects with their respective helper methods.

You can learn more about the driver in the official MongoDB PHP driver documentation, which you can find on the MongoDB driver documentation website. There you’ll find information to get started with the MongoDB PHP driver, including references, usage examples, fundamental concepts, and API documentation.

Understanding how MongoDB drivers can help you use MongoDB in your language of choice allows you to use MongoDB as the database for your applications.

Let’s recap what we covered in this video.

MongoDB PHP applications must use the official driver to ensure optimal performance and easy upgrading.

The MongoDB PHP extension is a low-level API for interacting with your MongoDB clusters in PHP.

The MongoDB PHP library offers a fully featured API to take advantage of MongoDB features.

Official driver documentation is available on the MongoDB website.