Docs Menu
Docs Home
/ / /
PHP Library Manual

What's New

On this page

  • What's New in 2.0
  • What's New in 1.20
  • What's New in 1.19
  • What's New in 1.18
  • What's New in 1.17

Learn about new features, improvements, and fixes introduced in the following versions of the MongoDB PHP Library:

  • Version 2.0

  • Version 1.20

  • Version 1.19

  • Version 1.18

  • Version 1.17

Important

Breaking Changes

The PHP library v2.0 release introduces the following breaking changes:

  • The following methods return void instead of the raw command response:

    • MongoDB\Client: dropDatabase()

    • MongoDB\Collection: drop(), dropIndex(), dropIndexes(), dropSearchIndex(), rename()

    • MongoDB\Database: createCollection(), drop(), dropCollection(), renameCollection()

To learn more about breaking changes in this release, see the Version 2.0 Breaking Changes section in the Upgrade Library Versions guide.

The PHP library v2.0 release includes the following API changes and removals:

  • Removes deprecated fields in GridFS types.

    • The library does not calculate the md5 field when a file is uploaded to GridFS. If your application requires a file digest, you must implement this process outside GridFS and store the values in metadata.

    • The fields contentType and aliases are no longer stored in the files GridFS collection. If your application requires this information, you must store it in metadata. To learn more about GridFS, see the Store Large Files guide.

  • Removes the following deprecated options for find operations:

    • maxScan

    • modifiers

    • oplogReplay

    • snapshot

    To learn about supported options for find operations, see the MongoDB\Collection::find() or MongoDB\Collection::findOne() API documentation.

  • Removes the deprecated IndexInfo::isGeoHaystack() method.

  • Removes the deprecated autoIndexId and flags options for the MongoDB\Database::createCollection() method.

  • Drops support for map-reduce functionality by removing the following deprecated methods and types:

    • MongoDB\Collection::mapReduce()

    • MongoDB\MapReduceResult

    You can rewrite map-reduce operations by using aggregation pipeline stages such as $group and $merge. To learn more, see Map-Reduce to Aggregation Pipeline in the MongoDB Server manual.

  • Removes the following Iterator implementations:

    • MongoDB\Model\CollectionInfoIterator

    • MongoDB\Model\DatabaseInfoIterator

    • MongoDB\Model\IndexInfoIterator

    The MongoDB\Client::listDatabases(), MongoDB\Database::listCollections(), and MongoDB\Collection::listIndexes() methods return a general traversable Iterator instance that provides the corresponding results.

Important

MongoDB Server v3.6 End-of-Life

Support for MongoDB Server v3.6 is removed in this release of the library.

The PHP library v1.20 release includes the following features, improvements, and fixes:

  • Adds support for MongoDB Server v8.0.

  • Adds support for Queryable Encryption (QE) range queries. To use this feature, your app must connect to MongoDB Server 8.0 or later. For more information about QE range queries, see Queryable Encryption in the MongoDB Server manual.

  • When a sharded cluster operation is unsuccessful, the library avoids selecting the same mongos server for operation retry attempts if other mongos servers are available.

  • When you create a KMIP data key, you can now specify the delegated option. If this option is set to true, the KMIP provider performs encryption and decryption of the data key locally, ensuring that the encryption key never leaves the KMIP server.

For more information about the changes in this version, see the v1.20 release notes on GitHub.

This release of the PHP library contains no significant changes and was added to keep version parity with the PHP extension.

The PHP library v1.18 release includes the following features, improvements, and fixes:

To learn more about this release, see the v1.18 Release Notes on GitHub.

The PHP library v1.17 release includes the following features, improvements, and fixes:

  • Introduces a new "codec" API for converting BSON to and from PHP objects. More information on this feature may be found in the Codecs tutorial.

  • Adds MongoDB\add_logger() and MongoDB\remove_logger() functions to the library. These functions allow applications to register a PSR-3 Logger to receive log messages emitted by the driver. Previously, logs were only available through the extension's mongodb.debug INI setting.

  • Introduces new MongoDB\Collection methods 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. To learn more about Atlas Search indexes and the specifics of the $search aggregation stage, see the Atlas Search indexes documentation and $search.

  • 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.

To learn more about this release, see the v1.17 Release Notes on GitHub.

Back

Compatibility