Skip to content

Releases: mongodb/mongo-php-library

1.21.1

04 Mar 16:36
37bc8df
Compare
Choose a tag to compare

The PHP team is happy to announce that version 1.21.1 of the MongoDB PHP library is now available.

Release Highlights

Remove dependency to extensions and PHP polyfill packages that are always available in PHP 8.1+.

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

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:1.21.1

Installation instructions for the mongodb extension may be found in the PHP.net documentation.

1.21.0

28 Feb 13:04
d216a5b
Compare
Choose a tag to compare

The MongoDB team is pleased to announce the release of version 1.21.0 of the MongoDB PHP Library.

This release introduces new features, enhancements, and deprecations in preparation for future improvements. It requires version 1.21.0 of the mongodb PHP extension, and PHP 8.1 or later.

New Features and Enhancements

  • Aggregation Builder: Introduces the builder framework to simplify writing aggregation pipelines and query filters.
  • Added support for the sort option in replaceOne and updateOne operations was added to better control which documents get updated
  • Method name changes: selectDatabase() and selectCollection methods are renamed to getDatabase and getCollection. The old names are deprecated and will be released in 3.0 to give projects ample time to update.
  • GridFS helpers: Introduces new methods deleteByName($filename) and renameByName($filename, $newFilename) to modify all the revisions of a file by its name.
  • When using array access on MongoDB\BSON\Document instances, integers are now accepted to access numeric keys in a BSON document
  • Distinct index: The hint option is now supported in distinct queries, improving index utilization.

Deprecations

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

  • Returned value of database and collection operations without meaningful result is deprecated. The typeMap option is deprecated when creating a collection or when dropping collections, databases and indexes.
  • Negative limit Values: Passing negative values for the limit option in queries is deprecated. Instead, use the singleBatch option.
  • Write Concern and Read Preference Changes: Passing WriteConcern or ReadPreference instances to command execution methods is deprecated. Use the writeConcern and readPreference options instead.
  • Float Arguments in UTCDateTime: Constructing MongoDB\BSON\UTCDateTime with a float argument is now deprecated.

Fixed bugs

  • In Find operation, ensure no cursor is left behind when limit == batchSize

Compatibility Updates

  • MongoDB Extension 1.21: This release requires to update the mongodb extension to the version 1.21
  • PHP 8.1 Required: Support for PHP 7.4 and 8.0 has been dropped. The minimum required version is now PHP 8.1.
  • Support for MongoDB 4.0 Deprecated: Future versions will require MongoDB 4.2 or later.

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

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:1.21.0

Installation instructions for the mongodb extension may be found in the PHP.net documentation.

1.20.0

25 Sep 13:21
75da9ea
Compare
Choose a tag to compare

The PHP team is happy to announce that version 1.20.0 of the MongoDB PHP library is now available.

Release Highlights

The PHP team is happy to announce that version 1.20.0 of the MongoDB PHP library is now available. This release introduces support for MongoDB 8.0.

Release Highlights

This release adds support for Queryable Encryption Range Queries when using MongoDB 8.0.

This release drops support for MongoDB 3.6. A future release will drop support for PHP 7.4 and 8.0.

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

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:1.20.0

Installation instructions for the mongodb extension may be found in the PHP.net documentation.

1.19.1

14 Jun 08:49
afe425b
Compare
Choose a tag to compare

The PHP team is happy to announce that version 1.19.1 of the MongoDB PHP library is now available.

Release Highlights

This version contains no user-facing changes but was made for internal compliance reasons.

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:1.19.1

Installation instructions for the mongodb extension may be found in the PHP.net documentation.

1.19.0

13 May 14:37
cbc8104
Compare
Choose a tag to compare

The PHP team is happy to announce that version 1.19.0 of the MongoDB PHP library is now available.

Release Highlights

This release contains no significant changes and was done to keep version parity with the MongoDB extension. Please note that a future minor release plans to raise the minimum supported MongoDB Server version from 3.6 to 4.0. This is in accordance with MongoDB Software Lifecycle Schedules.

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

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:1.19.0

Installation instructions for the mongodb extension may be found in the PHP.net documentation.

1.18.0

27 Mar 19:01
1.18.0
d421c41
Compare
Choose a tag to compare

The PHP team is happy to announce that version 1.18.0 of of the MongoDB PHP library is now available. This complements the 1.18.0 extension release.

Release Highlights

This release introduces a new GridFS API to make it more convenient to work with files using PHP's existing filesystem functions. The MongoDB\GridFS\Bucket::registerGlobalStreamWrapperAlias() method may be used to register a global alias for a GridFS bucket. After doing so, files within that bucket can be accessed using only a file URI (e.g. "gridfs://mybucket/hello.txt"). A demonstration of this API can be found in the gridfs_stream_wrapper.php example script.

The MongoDB\Client class now has addSubscriber() and removeSubscriber() methods to make it easier to register monitoring classes on the underlying MongoDB\Driver\Manager object.

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

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:1.19.0

Installation instructions for the mongodb extension may be found in the PHP.net documentation.

1.17.1

15 Mar 19:31
1.17.1
01d0840
Compare
Choose a tag to compare

The PHP team is happy to announce that version 1.17.1 of the MongoDB PHP library is now available.

Release Highlights

A complete list of resolved issues in this release may be found at:
https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=12483&version=37407

Documentation

Documentation for this library may be found at:
https://docs.mongodb.com/php-library/

Installation

This library may be installed or upgraded with:

composer require mongodb/mongodb:1.17.1

Installation instructions for the mongodb extension may be found in the PHP.net documentation.

1.17.0

15 Nov 09:26
1.17.0
9d9c917
Compare
Choose a tag to compare

The PHP team is happy to announce that version 1.17.0 of of the MongoDB PHP library is now available. This complements the 1.17.0 extension release.

Release Highlights

This release introduces a new "codec" API for converting BSON to and from PHP objects. Although this feature is implemented entirely in the library, it leverages the extension's MongoDB\BSON\Document object to work with raw BSON and lazily decode it as necessary. Unlike the extension's MongoDB\BSON\Serializable and MongoDB\BSON\Unserializable interfaces, codecs allow an application to separate the business logic in a PHP object representing a document from the logic necessary to convert it to/from BSON. To support this feature, a new codec option has been introduced on most classes and methods that currently accept a typeMap option; both options are mutually exclusive. More information on this feature may be found in the Codecs tutorial.

In conjunction with the MongoDB\Driver\Monitoring\LogSubscriber interface introduced in the corresponding extension version, MongoDB\add_logger() and MongoDB\remove_logger() functions have been introduced in the library. These functions allow applications to register a PSR-3 Logger to receive log messages emitted by the driver. Previously, logs were only accessible via the extension's mongodb.debug INI setting.

Several new MongoDB\Collection methods were introduced to create and manage Atlas Search indexes. Atlas Search indexes can be queried using the $search aggregation pipeline stage, which is supported in all versions of the library.

This release upgrades the mongodb extension requirement to 1.17.0. Support for PHP 7.2 and 7.3 has been removed and the library now requires PHP 7.4 or newer.

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

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:1.17.0

Installation instructions for the mongodb extension may be found in the PHP.net documentation.

Thanks

Thanks to our community contributors for 1.17.0:

1.16.1

28 Sep 00:54
1.16.1
72d8088
Compare
Choose a tag to compare

The PHP team is happy to announce that version 1.16.1 of the MongoDB PHP library is now available.

Release Highlights

A complete list of resolved issues in this release may be found at:
https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=12483&version=36260

Documentation

Documentation for this library may be found at:
https://docs.mongodb.com/php-library/

Installation

This library may be installed or upgraded with:

composer require mongodb/mongodb:1.16.1

Installation instructions for the mongodb extension may be found in the PHP.net documentation.

1.16.0

22 Jun 11:16
1.16.0
d4cdf05
Compare
Choose a tag to compare

The PHP team is happy to announce that version 1.16.0 of of the MongoDB PHP library is now available. This release introduces support for MongoDB 7.0.

Release Highlights

MongoDB\Database::createEncryptedCollection() was introduced. This method automatically creates data encryption keys when creating a new encrypted collection.

The new MongoDB\BSON\Document and MongoDB\BSON\PackedArray classes introduced in the corresponding extension version are now supported throughout the library. MongoDB\BSON\Document should be accepted anywhere that a BSON document is expected, and the new classes can be returned from BSON decoding by specifying bson in a type map.

This release upgrades the mongodb extension requirement to 1.16.0.

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

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:1.16.0

Installation instructions for the mongodb extension may be found in the PHP.net documentation.

Thanks

Thanks to our community contributors for 1.16.0: