1.1.0
The PHP team is happy to announce that version 1.1.0 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). This release adds support for GridFS and new features in MongoDB 3.4.
Release Highlights
This release supports new features of MongoDB 3.4. Some operations now accept a "collation" document option, which can be used to specify a locale-aware string comparison or sort order. See Collation in the MongoDB manual for additional information. Additionally, operations that write to the database now accept a "writeConcern" option. Attempting to use either of these options when not supported by the server will yield an exception.
This release includes an implementation of the GridFS specification, which allows reading and writing of GridFS files using PHP's streams and filesystem functions. MongoDB\Database::selectGridFSBucket()
may be used to instantiate a MongoDB\GridFS\Bucket
object, which is analogous to MongoDB::getGridFS()
and the MongoGridFS
class in the legacy driver, respectively. The MongoDB\GridFS\Bucket
class is documented in the API reference and GridFS tutorial. Note that GridFS files do not currently support file seeking and random access, although that functionality is planned in PHPLIB-213.
A getManager()
accessor method has been added to the MongoDB\Client
, MongoDB\Database
, and MongoDB\Collection
classes, which may be used to retrieve the MongoDB\Driver\Manager
extension object. The MongoDB\Model\BSONDocument
and MongoDB\Model\BSONArray
classes now implement PHP's JsonSerializable
interface. This complements the driver's BSON types implementing the same interface in version 1.2.0 of extension.
The Collection's findOneAndDelete()
, findOneAndReplace()
, and findOneAndUpdate()
methods now support a configurable "typeMap" option and inherit the Collection's type map by default. While these methods were previously restricted to returning a generic PHP object in 1.0.0, they now return a MongoDB\Model\BSONDocument
by default. Additionally, aggregate()
now applies the "typeMap" option when executing an aggregate
command that does not return a cursor (e.g. server versions < 2.6).
A complete list of resolved issues in this release may be found at:
https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=12483&version=16207
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.1.0
Installation instructions for the PHP and HHVM driver may be found in the PHP.net documentation.
Thanks
Thanks for our community contributors for this release: