2.0.0
·
20 commits
to v2.0
since this release
The PHP team is happy to announce that version 2.0.0 of the MongoDB PHP library is now available.
Release Highlights
- PHP Driver Major Release 2.0: This is a major release that introduces numerous changes and improvements across the library.
- Aggregation Builder Enhancement: Now allows passing an Aggregation Builder
Pipelinedirectly to theaggregatemethod. - Cursor Interface: Replaced the
Cursortype hints withCursorInterfacefor better extensibility and compatibility. - Removed Deprecated Methods: Methods and constants have been removed, ensuring cleaner and more streamlined code.
A complete list of resolved issues in this release may be found in JIRA.
New Features and Enhancements
- Aggregation Builder: The
aggregatemethod now supports passing an aggregation builderPipelinefor more flexible and readable queries. (PHPLIB-1617). - Cursor Interface: Type hints for cursor-related functionality have been replaced by
CursorInterfaceto allow more flexibility for custom cursor implementations. (PHPLIB-1114).
Deprecated and Removed Features
- GridFS Deprecated Fields: GridFS fields (
md5,contentType,aliases) have been removed, which may affect older implementations. (PHPLIB-1218). - Removed
Watch::FULL_DOCUMENT_DEFAULT Constant: TheFULL_DOCUMENT_DEFAULTconstant inWatchhas been removed (PHPLIB-818). - Deprecated
FindOptions Removed: Various deprecatedFindoptions have been removed as part of streamlining the API (PHPLIB-1511). - Removal of
mapReduceHelper: ThemapReducehelper has been removed fromCollectiondue to its deprecation in favor of other aggregation methods (PHPLIB-1513). - Removal of
autoIndexIdOption: TheautoIndexIdoption has been removed fromCreateCollection, simplifying collection creation (PHPLIB-1159).
Compatibility Updates
- MongoDB Extension 2.0: This release requires MongoDB extension version 2.0.0 or higher.
- PHP 8.1+ Required: The minimum required PHP version is now 8.1, as support for older versions (PHP 7.4 and 8.0) has been dropped.
- MongoDB 4.2+ Required: Future versions of the library will require MongoDB 4.2 or later. MongoDB 4.0 support is deprecated.
Documentation
Documentation for this library may be found in the PHP Library Manual.
Installation
This library may be installed or upgraded with:
composer require mongodb/mongodb:2.0.0
Installation instructions for the mongodb extension may be found in the PHP.net documentation.