mongodb

MongoDB driver for PHP


The purpose of this driver is to provide exceptionally thin glue between MongoDB
and PHP, implementing only fundamental and performance-critical components
necessary to build a fully-functional MongoDB driver.

License: Apache License

Latest releases

Version Release Download
2.1.1 2025-06-13 mongodb-2.1.1.tgz
2.1.0 2025-05-23 mongodb-2.1.0.tgz
2.0.0 2025-04-10 mongodb-2.0.0.tgz
1.21.1 2025-06-13 mongodb-1.21.1.tgz
1.21.0 2025-02-28 mongodb-1.21.0.tgz
Show all releases

Changelog

Version Message
2.1.1 ## What's Changed
* Ignore branches that are no longer maintained when merging up by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1838
* PHPC-2593: Update libmongoc to 1.30.5 by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1841


**Full Changelog**: https://github.com/mongodb/mongo-php-driver/compare/2.1.0...2.1.1
2.1.0 ## What's Changed
* Mention `Serializable` and `Unserializable` types in upgrade guide by @GromNaN in https://github.com/mongodb/mongo-php-driver/pull/1805
* Add CODEOWNERS for 1.21+ by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1810
* PHPC-2537 Update to newer Ubuntu version in GitHub Actions workflows by @GromNaN in https://github.com/mongodb/mongo-php-driver/pull/1814
* Feature: Client Bulk Write by @GromNaN in https://github.com/mongodb/mongo-php-driver/pull/1818
* PHPC-2580: Bump to libmongoc 1.30.4 by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1822
* PHPC-2510 Install evergreen tools using git submodule by @GromNaN in https://github.com/mongodb/mongo-php-driver/pull/1797
* PHPC-2555: Stop testing with MongoDB 4.0 by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1827
* PHPLIB-1678: Use assume_role command before accessing secrets by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1832


**Full Changelog**: https://github.com/mongodb/mongo-php-driver/compare/2.0.0...2.1.0
2.0.0 ## What's Changed
* PHPC-2447: Extend Iterator interface in CustorInterface by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1654
* PHP-1741: Remove getServer from APM event classes by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1652
* PHPC-2346: Remove deprecated BSON functions by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1653
* PHPC-2402: Remove range_preview constants by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1665
* PHPC-2140: Make tentative return types definitive by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1658
* PHPC-2351: Remove CursorId class by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1664
* PHPC-2342: Remove --with-libbson and --with-libmongoc configure options by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1667
* PHPC-1021: Remove support for ReadPreference integer modes by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1666
* Update version for 2.x branch by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1672
* PHPC-2248: Remove Serializable implementations by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1663
* PHPC-2444: Remove support for string arguments in UTCDateTime constructor by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1662
* PHPC-2309: Remove --with-openssl-dir configure option by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1676
* PHPC-2417 Add `UTCDateTimeInterface::toDateTimeImmutable()` by @GromNaN in https://github.com/mongodb/mongo-php-driver/pull/1684
* PHPC-2348 Remove `WriteException` and move `getWriteResult` to `BulkWriteException` by @GromNaN in https://github.com/mongodb/mongo-php-driver/pull/1685
* PHPC-2454: Remove --enable-system-ciphers configure option by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1681
* PHPC-2144 Throw a LogicException when getting info from unacknowledged write result by @GromNaN in https://github.com/mongodb/mongo-php-driver/pull/1687
* PHPC-2344 Remove SSLConnectionException by @GromNaN in https://github.com/mongodb/mongo-php-driver/pull/1696
* PHPC-2459: Remove support for float arg in UTCDateTime ctor by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1709
* PHPC-2440: Remove deprecated Query constructor options by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1707
* PHPC-990: Strict type validation for boolean URI options by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1713
* PHPC-2441: Remove deprecated Manager constructor options by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1719
* PHPC-2497: BulkWriteException stub should inherit ServerException by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1784
* PHPC-2485: Remove WriteConcern and ReadPreference from execute method arginfo by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1783
* PHPC-2536: Migrate to common OCSP responder script by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1800
* PHPC-2536: Remove run-ocsp-responder.sh by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1802
* PHPC-2558: Update to libmongoc 1.30.3 by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1806


**Full Changelog**: https://github.com/mongodb/mongo-php-driver/compare/1.21.0...2.0.0
1.21.1 ## What's Changed
* PHPC-2558: Update to libmongoc 1.30.3 by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1806
* Add CODEOWNERS for 1.21+ by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1810
* PHPC-2537 Update to newer Ubuntu version in GitHub Actions workflows by @GromNaN in https://github.com/mongodb/mongo-php-driver/pull/1814
* PHPLIB-1678: Use assume_role command before accessing secrets by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1832
* Ignore branches that are no longer maintained when merging up by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1838
* PHPC-2593: Update libmongoc to 1.30.5 by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1841


**Full Changelog**: https://github.com/mongodb/mongo-php-driver/compare/1.21.0...1.21.1
1.21.0 ## What's Changed
* PHPC-2343: Require PHP 8.1 by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1631
* Update branch names for GHA workflows by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1646
* Bump version to 1.21-dev by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1661
* Document how to run part of the test suite by @GromNaN in https://github.com/mongodb/mongo-php-driver/pull/1690
* PHPC-2458: Deprecate float arg for UTCDateTime constructor by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1695
* PHPC-2464: Emit deprecation notice for negative "limit" Query option by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1710
* PHPC-2460: Use zend_zval_type_name instead of internal macros by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1714
* PHPC-1247: Update links to PHP.net docs by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1735
* Test PPC and Zseries on RHEL 9 by @alcaeus in https://github.com/mongodb/mongo-php-driver/pull/1740
* PHPC-2472: Update to libmongocrypt 1.12.0 by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1743
* PHPC-2473: Bump to libmongoc 1.29.0 by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1748
* PHPC-2471: Sync BSON corpus tests for Y10K date parsing by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1742
* Use correct arch name in Windows artifacts. by @mickverm in https://github.com/mongodb/mongo-php-driver/pull/1762
* PHPC-2499: Update to libmongoc 1.29.2 by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1766
* PHPC-2496: WriteException stub should inherit ServerException by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1769
* PHPC-2477: Remove unused libmongoc and libbson constants by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1768
* PHPC-2502: Remove XFAIL in server-executeQuery-012.phpt by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1772
* PHPC-2489: Deprecate passing WriteConcern and ReadPreference objects to execute methods by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1770
* PHPC-2501: Conditionally define MONGOC_CYRUS_PLUGIN_PATH_PREFIX on Windows by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1777
* PHPC-2503: Conditionally allow more concise output for libbson 1.30 by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1779
* PHPC:2498: Accept integer types for Document array access by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1781
* PHPC-2508 and PHPC-2506: Bump libmongoc to 1.30 by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1785
* PHPC-2513: Check for returned _id before appending insert by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1788
* PHPC-2519: Bump libmongoc to 1.30.1 by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1792
* PHPC-2518: Support sort option for updateOne and replaceOne by @jmikola in https://github.com/mongodb/mongo-php-driver/pull/1794
* Use pre-packaged-source for pie downloads by @asgrim in https://github.com/mongodb/mongo-php-driver/pull/1782

## New Contributors
* @asgrim made their first contribution in https://github.com/mongodb/mongo-php-driver/pull/1782

**Full Changelog**: https://github.com/mongodb/mongo-php-driver/compare/1.20.1...1.21.0
Show complete changelog