Doctrine MongoDB ODM 1.1.0 and 1.0.6 Released

We are happy to announce the immediate availability of Doctrine MongoDB ODM 1.1.0 and 1.0.6.

What is new in 1.1.0?

Doctrine MongoDB ODM 1.1.0 comes with the following new features: - ODM now supports sharded collections out of the box - Users may provide custom implementations for 1-n associations - Fetch documents in read-only mode - Partial indexes, which were introduced in MongoDB 3.2 - PHP 7 support - and much more

PHP 7 support

Running MongoDB ODM on PHP 7 requires the new MongoDB driver (ext-mongodb) which is not directly compatible with ODM. To solve this, you can use a polyfill like mongo-php-adapter, which provides the legacy driver API on top of the new driver. To do so, in your PHP 7 project, add the following Composer directives in addition to the MongoDB ODM requirement:

    "require": {
        "alcaeus/mongo-php-adapter": "^1.0",
        "ext-mongo": "*"


Due to a bug in Composer you need to include a requirement to ext-mongo. This requirement will be correctly filled by mongo-php-adapter.

Upgrading to 1.1.0

The new version requires PHP 5.6+; older versions are no longer supported. If you are using an older version, please use Doctrine MongoDB ODM 1.0.x or upgrade your PHP version. In addition to these PHP version changes, MongoDB ODM 1.1.0 requires version 1.5 or newer of the legacy MongoDB driver. The new MongoDB driver is supported using polyfill (like mongo-php-adapter mentioned above).

To use custom collection classes, you must set a persistentCollectionDir in the configuration. This is an optional feature and is not required by default.

Several features have been deprecated and will be dropped in the 2.0 release: - All specific type annotations (e.g. @String) have been deprecated. Please use

the @Field annotation instead.
  • The Increment type has been deprecated in favor of a storage strategy combined with the Integer and Float type
  • The simple flag for references has been replaced with storeAs, allowing more flexibility.


You can install this version of MongoDB ODM by using Composer and the following composer.json contents:

    "require": {
        "doctrine/mongodb-odm": "^1.1.0"

MongoDB ODM 1.0.6

Notable fixes may be found in the changelog. A full list of issues and pull requests included in this release may be found in the 1.0.6 milestone.


As of today, Doctrine MongoDB ODM 1.1.0 is the stable distribution. There is no release schedule for an upcoming version yet.

Due to the requirement changes introduced with MongoDB ODM 1.1.0 we have decided to provide bug fixes as well as security fixes for MongoDB ODM 1.0.x for an additional 6 months. After that, 1.0.x will no longer be supported.

comments powered by Disqus
Fork me on GitHub