MongoDB PHP Library
Overview
Welcome to the documentation site for the official MongoDB PHP Library.
The PHP library provides a high-level abstraction around the lower-level mongodb extension.
The mongodb
extension provides a limited API to connect to a MongoDB
database and execute generic commands, queries, and write operations. In
contrast, the PHP library provides a full-featured API and models client,
database, and collection objects. If you are developing a PHP application with
MongoDB, consider using the PHP library instead of the extension alone.
Get Started
Learn how to install the library and extension, establish a connection to MongoDB, and begin working with data in the Get Started with the PHP Library tutorial.
Connect to MongoDB
Learn how to create and configure a connection to a MongoDB deployment in the Connect to MongoDB section.
Databases and Collections
Learn how to use the PHP library to work with MongoDB databases and collections in the Databases and Collections section.
Read and Write Data
Learn how to find, update, and delete data in the CRUD Operations section.
Transform Your Data with Aggregation
Learn how to use the PHP library to perform aggregation operations in the Transform Your Data with Aggregation section.
Data Formats
Learn how to work with specialized data formats and custom types in the Specialized Data Formats section.
Optimize Queries with Indexes
Learn how to work with common types of indexes in the Optimize Queries by Using Indexes section.
Run a Database Command
Learn how to run a database command in the Run a Database Command section.
Atlas Search
Learn how to run Atlas Search queries in the Atlas Search section.
Atlas Vector Search
Learn how to run Atlas Vector Search queries in the Atlas Vector Search section.
Monitoring and Logging
Learn how to monitor changes to your application and write them to logs in the Monitoring and Logging section.
Secure Your Data
Learn about ways you can authenticate your application and encrypt your data in the Secure Your Data section.
Reference
Learn more about PHP library versions, compatibility, and upgrade considerations in the Reference section.
FAQ
See answers to commonly asked questions about the PHP library in the the Frequently Asked Questions section.
Issues & Help
Learn how to report bugs, contribute to the library, and find help in the Issues & Help section.