The PHP team is happy to announce that version 1.3.0 of the MongoDB PHP library is now available. This library is a high-level abstraction for the
mongodb extension. This release adds support for new features in
MongoDB 3.6 and drops support for MongoDB 2.4 and earlier.
Release HighlightsVersion 1.4.0 of the `mongodb` extension introduced a new `MongoDB\Driver\Session` class to support
client sessions for MongoDB 3.6. Session objects may be created via a new `MongoDB\Client::startSession()` method. All Client, Database, and Collection methods that communicate with the server now accept a "session" option. Presently, this option may be used for facilitating
causally consistent reads. Sessions are not currently supported for GridFS operations.
MongoDB 3.6 introduced
change streams, which allows applications to subscribe to all data changes on a collection (without manually tailing the
oplog). Change streams are implemented using the aggregation framework and tailable cursors. This release adds support for change streams via a new `MongoDB\Collection::watch()` method, which returns a `MongoDB\ChangeStream` iterator. This iterator wraps a `MongoDB\Driver\Cursor` object and implements additional functionality, such as automatic resuming in the event of a dropped connection. A new
tutorial on tailable cursor iteration has been added to the documentation, which is relevant for anyone working with tailable cursors or change streams.
Update methods (e.g. `updateMany()`, `findOneAndUpdate()`) now support an `arrayFilters` option, which may be used to specify which elements to modify in an array field. See
Specify arrayFilters for Array Update Operations in the MongoDB manual for more information on this new feature.
`MongoDB\Client::listDatabases()` now supports a `filter` option, which may be used to filter which databases are returned when connected to MongoDB 3.6.
This release upgrades the `mongodb` extension requirement to 1.4.0. Support for MongoDB 2.4 and earlier has been removed.
A complete list of resolved issues in this release may be found at:
https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=12483&version=18790DocumentationDocumentation for this library may be found at:
https://docs.mongodb.com/php-library/InstallationThis library may be installed or upgraded with:
composer require mongodb/mongodb=^1.3.0
Installation instructions for the `mongodb` extension may be found in the
PHP.net documentation.
ThanksThanks for our community contributors for this release: