mongo-php-library

The Official MongoDB PHP library

APACHE-2.0 License

Downloads
44.9M
Stars
1.6K
Committers
48

Bot releases are hidden (Show)

mongo-php-library - 1.19.0

Published by alcaeus 5 months ago

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.

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.

mongo-php-library - 1.18.0

Published by jmikola 7 months ago

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.

mongo-php-library - 1.17.1

Published by jmikola 7 months ago

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.

mongo-php-library - 1.17.0

Published by jmikola 11 months ago

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:

mongo-php-library - 1.16.1

Published by jmikola about 1 year ago

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.

mongo-php-library - 1.16.0

Published by jmikola over 1 year ago

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:

mongo-php-library - 1.15.0

Published by jmikola almost 2 years ago

The PHP team is happy to announce that version 1.15.0 of the MongoDB PHP library is now available. Note that version 1.14.0 has been intentionally skipped to restore version parity between the library and extension.

Release Highlights

New examples/ and tools/ directories have been added to library repository, which contain code snippets and scripts that may prove useful when writing or debugging applications, respectively. These directories are intended to supplement the library's existing documentation, and will be added to over time.

Various backwards compatible typing improvements have been made throughout the library. Downstream impact for these changes are discussed in UPGRADE-1.15.md. Additionally, Psalm has been integrated for static analysis going forward.

This release upgrades the mongodb extension requirement to 1.15.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.15.0

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

mongo-php-library - 1.13.1

Published by jmikola about 2 years ago

The PHP team is happy to announce that version 1.13.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=34481

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

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

mongo-php-library - 1.13.0

Published by jmikola over 2 years ago

The PHP team is happy to announce that version 1.13.0 of the MongoDB PHP library is now available. This release introduces support for MongoDB 6.0 and Queryable Encryption.

Release Highlights

MongoDB\Database::createCollection, MongoDB\Database::dropCollection, and MongoDB\Collection::drop now support an encryptedFields option. This is used by the library to manage internal collections used for queryable encryption.

Helper methods for find, findAndModify, delete, and update commands now support a let option, which can be used to define variables that can be accessed within query filters and updates. Additionally, all helpers now support a comment option of any type (previously a string comment was only supported for queries).

Change Streams with Document Pre- and Post-Images are now supported. Change stream watch() helpers now accept "whenAvailable" and "required" for the fullDocument option and support a new fullDocumentBeforeChange option, which accepts "whenAvailable" and "required". Change events may now include a fullDocumentBeforeChange response field. Additionally, MongoDB\Database::createCollection() and MongoDB\Database::modifyCollection() now support a changeStreamPreAndPostImages option to enable this feature on collections. Lastly, change stream watch() helpers now accept a showExpandedEvents option to enable the server to return additional events for DDL operations (e.g. creating indexes and collections) in the change stream.

MongoDB\Database::createCollection() now supports creating clustered indexes and views. Clustered indexes were introduced in MongoDB 5.3. Views date back to MongoDB 3.4 but the corresponding options for the create command were never added to the library's helper method.

MongoDB\Collection::estimatedDocumentCount() has been changed to always use the count command. In a previous release (1.9.0), the method was changed to use aggregate with a $collStats stage instead of the count command, which did not work on views. Reverting estimatedDocumentCount() to always use the count command addresses the incompatibility with views. Due to an oversight, the count command was omitted from the Stable API in server versions 5.0.0–5.0.8 and 5.1.0–5.3.1. Users of the Stable API with estimatedDocumentCount are advised to upgrade their MongoDB clusters to 5.0.9+ or 5.3.2+ (if on Atlas) or disable strict mode when using MongoDB\Driver\ServerApi.

This release upgrades the mongodb extension requirement to 1.14.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.13.0

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

mongo-php-library - 1.13.0-beta1

Published by jmikola over 2 years ago

The PHP team is happy to announce that version 1.13.0-beta1 of the MongoDB PHP library is now available. This release introduces support for MongoDB 6.0 and Queryable Encryption.

Release Highlights

MongoDB\Database::createCollection, MongoDB\Database::dropCollection, and MongoDB\Collection::drop now support an encryptedFields option. This is used by the library to manage internal collections used for queryable encryption.

Helper methods for find, findAndModify, delete, and update commands now support a let option, which can be used to define variables that can be accessed within query filters and updates. Additionally, all helpers now support a comment option of any type (previously a string comment was only supported for queries).

Change Streams with Document Pre- and Post-Images are now supported. Change stream watch() helpers now accept "whenAvailable" and "required" for the fullDocument option and support a new fullDocumentBeforeChange option, which accepts "whenAvailable" and "required". Change events may now include a fullDocumentBeforeChange response field. Additionally, MongoDB\Database::createCollection() and MongoDB\Database::modifyCollection() now support a changeStreamPreAndPostImages option to enable this feature on collections.

MongoDB\Database::createCollection() now supports creating clustered indexes and views. Clustered indexes were introduced in MongoDB 5.3. Views date back to MongoDB 3.4 but the corresponding options for the create command were never added to the library's helper method.

MongoDB\Collection::estimatedDocumentCount() has been changed to always use the count command. In a previous release (1.9.0), the method was changed to use aggregate with a $collStats stage instead of the count command, which did not work on views. Reverting estimatedDocumentCount() to always use the count command addresses the incompatibility with views. Due to an oversight, the count command was omitted from the Stable API in server versions 5.0.0–5.0.8 and 5.1.0–5.3.1. Users of the Stable API with estimatedDocumentCount are advised to upgrade their MongoDB clusters to 5.0.9+ or 5.3.2+ (if on Atlas) or disable strict mode when using MongoDB\Driver\ServerApi.

This release upgrades the mongodb extension requirement to 1.14.0-beta1.

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

Documentation

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

Installation

This library may be installed or upgraded with:

composer require mongodb/mongodb:1.13.0-beta1@dev

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

mongo-php-library - 1.12.0

Published by jmikola over 2 years ago

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

Release Highlights

MongoDB\Database::listCollections() now supports an authorizedCollections option, which is supported by MongoDB 4.0 and later.

The MongoDB\Collection::mapReduce() method has been deprecated. This corresponds to the deprecation of the mapReduce command in MongoDB 5.0. Users currently relying on mapReduce are encouraged to migrate to using the aggregation framework (see: Map-Reduce to Aggregation Pipeline).

This release upgrades the mongodb extension requirement to 1.13.0. Support for MongoDB 3.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=32496

Documentation

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

Installation

This library may be installed or upgraded with:

composer require mongodb/mongodb^1.12.0

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

mongo-php-library - 1.11.0

Published by jmikola almost 3 years ago

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

Release Highlights

This release is compatible with PHP 8.1.0. Several deprecation notices have been addressed.

GridFS stream operations will now throw the underlying exception instead of converting it to a PHP warning, as was done in previous versions of the library.

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

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

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

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

Thanks

Thanks to our community contributors for 1.11.0:

mongo-php-library - 1.10.1

Published by jmikola almost 3 years ago

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

Release Highlights

This release changes the server selection logic for Database::aggregate() and Collection::aggregate() when the pipeline contains $out or $merge. The 1.10.0 release added support for executing these pipelines on 5.0+ secondaries, but introduced a bug that could cause a server selection failure in a mixed version replica set. With this change, a secondary will only be eligible if all servers in the topology are 5.0+; otherwise, the library will fall back to selecting a primary server.

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

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

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

mongo-php-library - 1.10.0

Published by jmikola almost 3 years ago

The PHP team is happy to announce that version 1.10.0 of the MongoDB PHP library is now available. This release adds support for new features in MongoDB 5.0.

Release Highlights

Database::aggregate() and Collection::aggregate() now support executing $out and $merge pipelines on 5.0+ secondaries and will no longer force a primary read preference. If a pre-5.0 secondary would be selected, aggregate() will fall back to selecting a primary server.

New Database::renameCollection() and Collection::rename() methods were introduced, which abstract the renameCollection command.

This release upgrades the mongodb extension requirement to 1.11.0.

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

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

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

Thanks

Thanks to our community contributors for 1.10.0:

mongo-php-library - 1.9.0

Published by jmikola over 3 years ago

The PHP team is happy to announce that version 1.9.0 of the MongoDB PHP library is now available. This release adds support for new features in MongoDB 5.0.

Release Highlights

The aggregate() methods now support a let option. A document may be specified to define variables that will then be accessible within the pipeline. This feature requires MongoDB 5.0 and is described in more detail in the aggregate command reference.

Database::createCollection() supports creation of time series collections using new timeseries and expireAfterSeconds options. This feature requires MongoDB 5.0 and is described in more detail in the create command reference.

The CollectionInfo class returned by Database::listCollections() has several new methods to improve access to the server's result objects: getInfo(), getType(), and getIdIndex(). Additionally, the getCappedMax(), getCappedSize(), and isCapped() methods have been deprecated.

This release upgrades the mongodb extension requirement to 1.10.0. Support for PHP 7.0 has been removed and the library now requires PHP 7.1 or newer.

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

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

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

Thanks

Thanks for our community contributors for 1.9.0:

mongo-php-library - 1.9.0-alpha1

Published by alcaeus over 3 years ago

The PHP team is happy to announce that the first alpha release of version 1.9.0 of the MongoDB PHP library is now available. This library is a high-level abstraction for the mongodb extension.

Release Highlights

This release adds support for Stable API (which will be released with MongoDB 5.0) and using Azure and GCP keystrokes for client-side field level encryption.

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

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.9.0@alpha

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

mongo-php-library - 1.8.0

Published by alcaeus almost 4 years ago

The PHP team is happy to announce that version 1.8.0 of the MongoDB PHP library is now available. This library is a high-level abstraction for the mongodb extension.

Release Highlights

This release makes the library compatible with PHP 8.

With this release, errors that occur while copying GridFS stream contents will now cause an exception instead of relying on PHP to emit a warning. This primarily affects the downloadToStream, downloadToStreamByName, and uploadFromStream methods for MongoDB\GridFS\Bucket.

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

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

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

mongo-php-library - 1.8.0-RC1

Published by alcaeus almost 4 years ago

The PHP team is happy to announce that the first release candidate of version 1.8.0 of the MongoDB PHP library is now available. This library is a high-level abstraction for the mongodb extension.

Release Highlights

This release makes the library compatible with PHP 8.

With this release, errors that occur while copying GridFS stream contents will now cause an exception instead of relying on a PHP Warning being emitted.

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

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.8.0-RC1

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

mongo-php-library - 1.7.2

Published by alcaeus almost 4 years ago

The PHP team is happy to announce that version 1.7.2 of the MongoDB PHP library is now available. This library is a high-level abstraction for the mongodb extension.

Release Highlights

This release removes an unnecessary field from createIndexes commands.

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

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

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

mongo-php-library - 1.7.1

Published by alcaeus about 4 years ago

The PHP team is happy to announce that version 1.7.1 of the MongoDB PHP library is now available. This library is a high-level abstraction for the mongodb extension.

Release Highlights

This release fixes errors during PHP shutdown if GridFS streams were left open in a dirty state.

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

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

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