Releases: mongodb/mongo-php-library
1.5.0
The PHP team is happy to announce that version 1.5.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 4.2.
Release Highlights
Together with version 1.6.0 of the mongodb
extension, this release allows running multi-document transactions on sharded clusters when connected to MongoDB 4.2.
To make working with transactions easier, this release introduces a new, more convenient API for executing transactions. The new MongoDB\with_transaction()
function takes a MongoDB\Driver\Session
argument and a callback that will be run within a transaction for the given session. The function itself handles starting and committing the transaction, as well as handling any retryable errors that occur during the process.
Change stream iterators now provide a MongoDB\ChangeStream::getResumeToken()
method, which allows retrieving a token that can be used to resume the change stream after the current position. This token can be used with the resumeAfter
option, as well as the new startAfter
option introduced in MongoDB 4.2. The latter allows resuming a change stream after an "invalidate" event, such as dropping or renaming a collection.
Update methods (e.g. updateMany()
, findOneAndUpdate()
) now support passing an aggregation pipeline for the update
argument. This allows for more complex atomic updates than before. See Update with an Aggregation Pipeline in the MongoDB manual for more information on this new feature.
This release adds compatibility with PHP 7.4 and drops support for PHP 5.5.
This release upgrades the mongodb
extension requirement to 1.6.0.
A complete list of resolved issues in this release may be found at: https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=12483&version=21085
Documentation
Documentation for this library may be found at:
https://docs.mongodb.com/php-library/
Feedback
If you encounter any bugs or issues with this library, please report them via this form:
https://jira.mongodb.org/secure/CreateIssue.jspa?pid=12483&issuetype=1
Installation
This library may be installed or upgraded with:
composer require mongodb/mongodb^1.5.0
Installation instructions for the mongodb
extension may be found in the PHP.net documentation.
Thanks
Thanks for our community contributors for this release:
1.4.3
The PHP team is happy to announce that version 1.4.3 of the MongoDB PHP library is now available. This library is a high-level abstraction for the mongodb
extension.
Release Highlights
This release addresses two bugs related to resuming a change stream during its iteration. The iteration key reported by the change stream is now properly incremented for an iteration event that resumes. Additionally, the resume token is now correctly updated on consecutive resume attempts.
A complete list of resolved issues in this release may be found at:
https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=12483&version=23304
Documentation
Documentation for this library may be found at:
https://docs.mongodb.com/php-library/
Feedback
If you encounter any bugs or issues with this library, please report them via this form:
https://jira.mongodb.org/secure/CreateIssue.jspa?pid=12483&issuetype=1
Installation
This library may be installed or upgraded with:
composer require mongodb/mongodb^1.4.3
Installation instructions for the mongodb
extension may be found in the PHP.net documentation.
1.4.2
The PHP team is happy to announce that version 1.4.2 of the MongoDB PHP library is now available. This library is a high-level abstraction for the mongodb
extension.
Release Highlights
This releases addresses a bug where MongoDB\Collection::countDocuments()
would throw an exception if no documents are found. Some tests were improved too.
A complete list of resolved issues in this release may be found at:
https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=12483&version=21113
Documentation
Documentation for this library may be found at:
https://docs.mongodb.com/php-library/
Feedback
If you encounter any bugs or issues with this library, please report them via this form:
https://jira.mongodb.org/secure/CreateIssue.jspa?pid=12483&issuetype=1
Installation
This library may be installed or upgraded with:
composer require mongodb/mongodb^1.4.2
Installation instructions for the mongodb
extension may be found in the PHP.net documentation.
1.4.1
The PHP team is happy to announce that version 1.4.1 of the MongoDB PHP library is now available. This library is a high-level abstraction for the mongodb
extension.
Release Highlights
This release contains a fix for cloning MongoDB\Model\BSONArray
and MongoDB\Model\BSONDocument
objects that contain uncloneable PHP objects.
A complete list of resolved issues in this release may be found at:
https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=12483&version=20988
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.4.1
Installation instructions for the mongodb
extension may be found in the PHP.net documentation.
1.4.0
The PHP team is happy to announce that version 1.4.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 4.0 and drops support for MongoDB 2.6 and earlier.
Release Highlights
MongoDB 4.0 introduces support for cluster-level and database-level change streams, which may be created via the new MongoDB\Client::watch()
and MongoDB\Database::watch()
methods, respectively. All change streams now support a startAtOperationTime
option, which can be used to specify an exact point in time for the change stream to begin. Additionally, the internal logic for resuming change streams after encountering an error has been improved.
New MongoDB\Collection::countDocuments()
and MongoDB\Collection::estimatedDocumentCount()
methods have been introduced. countDocuments()
may be executed within a transaction and should be preferred where an exact document count is required. estimatedDocumentCount()
cannot be executed within a transaction but may otherwise be used when an approximate, non-filtered count is acceptable. The MongoDB\Collection::count()
has been deprecated (in documentation only) due to its incompatibility with transactions and inaccuracy in sharded clusters. Users should note that countDocuments()
uses an aggregation pipeline instead of the count
command, so it does not support $where
, $near
, and $nearSphere
query operators accepted in a count()
filter (alternative syntax is discussed in the countDocuments()
documentation).
A MongoDB\Collection::explain()
method has been introduced as a helper for the explain
command, which may be used to explain operations such as find
, findAndModify
, update
, and others. MongoDB\Collection::aggregate()
now also supports an explain
option (note: the server's API for explaining aggregate
differs from other commands).
Several usability improvements were made for the library's model classes for database, collection, and index information. Additionally, a MongoDB\Database::modifyCollection()
method has been introduced as a wrapper for the collMod
command.
This release upgrades the mongodb
extension requirement to 1.5.0. Support for MongoDB 2.6 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=19898
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.4.0
Installation instructions for the mongodb
extension may be found in the PHP.net documentation.
1.3.2
The PHP team is happy to announce that version 1.3.2 of the MongoDB PHP library is now available. This library is a high-level abstraction for the mongodb
extension.
Release Highlights
This release contains fixes for session consistency in change streams and executing findAndModify
commands when a client-level read concern has been specified.
A complete list of resolved issues in this release may be found at:
https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=12483&version=20437
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.3.2
Installation instructions for the mongodb
extension may be found in the PHP.net documentation.
1.3.1
The PHP team is happy to announce that version 1.3.1 of the MongoDB PHP library is now available. This library is a high-level abstraction for the mongodb
extension.
Release Highlights
This release contains fixes for key incrementing in ChangeStream::next()
and resume functionality in ChangeStream::rewind()
. Additionally, it includes a performance improvement for seeking forward in GridFS files.
A complete list of resolved issues in this release may be found at:
https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=12483&version=19818
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.3.1
Installation instructions for the mongodb
extension may be found in the PHP.net documentation.
Thanks
Thanks for our community contributors for this release:
1.3.0
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 Highlights
Version 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=18790
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.3.0
Installation instructions for the mongodb
extension may be found in the PHP.net documentation.
Thanks
Thanks for our community contributors for this release:
1.2.0
The PHP team is happy to announce that version 1.2.0 of the MongoDB PHP library is now available. This library is a high-level abstraction for the mongodb
extension.
Release Highlights
This release bumps the library's PHP requirement to 5.5 and mongodb
extension requirement to 1.3.
The Collection class now has a mapReduce()
command helper. The Collection find()
and findOne()
methods now support additional options, which brings them in sync with the extension's MongoDB\Driver\Query
class.
Core classes now have accessor methods for common options: read concern, read preference, type map, and write concern. Additionally, the GridFS Bucket class now has accessors for the chunkSizeBytes option and files and chunks collection objects.
GridFS streams now support seeking via fseek()
, which allows for partial file retrieval. Iterators returned by Database::listCollections()
and Collection::listIndexes()
can now be rewound and iterated multiple times.
Starting with this version, API changes such as new methods and options will be highlighted in the documentation.
A complete list of resolved issues in this release may be found at:
https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=12483&version=17734
Documentation
Documentation for this library may be found at:
https://docs.mongodb.com/php-library/
Feedback
If you encounter any bugs or issues with this library, please report them via this form:
https://jira.mongodb.org/secure/CreateIssue.jspa?pid=12483&issuetype=1
Installation
This library may be installed or upgraded with:
composer require mongodb/mongodb=^1.2.0
Installation instructions for the mongodb
extension may be found in the PHP.net documentation.
Thanks
Thanks for our community contributors for this release:
1.2.0-alpha1
The PHP team is happy to announce that version 1.2.0-alpha1 of our MongoDB PHP library is now available. This library is a high-level abstraction for the PHP 5, PHP 7, and HHVM drivers (i.e. mongodb
extension).
Release Highlights
This release adds support for seeking and partial file retrieval of GridFS files (PHPLIB-213). This means that PHP's fseek()
and ftell()
functions can now be used on readable GridFS streams (e.g. resources returned by Bucket::openDownloadStream()
). Seeking is not supported for writable streams, which are append-only and always positioned at the end of the stream.
A complete list of resolved issues in this release may be found at:
https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=12483&version=18050
Documentation
Documentation for this library may be found at:
https://docs.mongodb.com/php-library/
Feedback
If you encounter any bugs or issues with this library, please report them via this form:
https://jira.mongodb.org/secure/CreateIssue.jspa?pid=12483&issuetype=1
Installation
This library may be installed or upgraded with:
composer require mongodb/mongodb=^1.2.0-alpha1
Installation instructions for the PHP and HHVM driver may be found in the PHP.net documentation.