github mongodb/mongo-php-driver 1.21.0

one day ago

The PHP team is happy to announce that version 1.21.0 of the mongodb PHP extension is now available on PECL.

Release Highlights

This release adds a few quality of life features:

  • Support for the sort option in replaceOne and updateOne operations was added to better control which documents get updated
  • When using array access on MongoDB\BSON\Document instances, integers are now accepted to access numeric keys in a BSON document

In this release, we also deprecated a number of features in preparation for an upcoming 2.0 release:

  • Float arguments when constructing MongoDB\BSON\UTCDateTime are now deprecated
  • Passing a WriteConcern or ReadPreference instance to the executeQuery, executeCommand, executeReadCommand, executeReadWriteCommand, and executeWriteCommand methods in MongoDB\Driver\Manager and MongoDB\Driver\Server is deprecated. Please use the corresponding writeConcern and readPreference options instead.
  • Passing a negative limit option to queries is now deprecated. Instead of negative limits, use a positive limit option and use the singleBatch option to receive to only receive a single batch of results.

This release drops support for PHP 7.4 and PHP 8.0 - PHP 8.1 is now the minimum version for the PHP driver. The libmongoc and libmongocrypt dependencies have been bumped to 1.30.1 and 1.12.0 respectively.

Support for MongoDB 4.0 is now deprecated. A future release of the driver will bump the minimum requirement to MongoDB 4.2.

A complete list of resolved issues in this release may be found in JIRA.

Documentation

Documentation is available on PHP.net.

Installation

You can either download and install the source manually, or you can install the extension with:

pecl install mongodb-1.21.0

or update with:

pecl upgrade mongodb-1.21.0

Windows binaries are attached to the GitHub release notes.

Don't miss a new mongo-php-driver release

NewReleases is sending notifications on new releases.