doctrine/mongodb
Doctrine MongoDB library for PHP, providing an object-oriented API for working with MongoDB. Includes database and collection abstractions, query and command builders, and tools for common CRUD operations—ideal as a low-level MongoDB foundation for PHP apps.
We are happy to announce the immediate availability of Doctrine MongoDB Abstraction Layer 1.6.3.
This release fixes a bug with the popFirst and popLast methods in Expr which causes the wrong elements to be removed.
A full list of issues and pull requests included in this release may be found in the 1.6.3 milestone.
This library requires PHP 5.6 or newer. If you are using PHP 7.0 or newer, you can use this library by adding a polyfill for ext-mongo, like mongo-php-adapter.
We are happy to announce the immediate availability of Doctrine MongoDB Abstraction Layer 1.6.2.
This release fixes a bug when uploading GridFS files when the read preference on the collection has been set to secondary or secondaryPreferred.
A full list of issues and pull requests included in this release may be found in the 1.6.2 milestone.
This library requires PHP 5.6 or newer. If you are using PHP 7.0 or newer, you can use this library by adding a polyfill for ext-mongo, like mongo-php-adapter.
We are happy to announce the immediate availability of Doctrine MongoDB Abstraction Layer 1.6.1.
This release fixes a bug with empty $match stages in aggregation builder and fixes the generated pipeline stage for $bucketAuto aggregation pipeline stages.
A full list of issues and pull requests included in this release may be found in the 1.6.1 milestone.
This library requires PHP 5.6 or newer. If you are using PHP 7.0 or newer, you can use this library by adding a polyfill for ext-mongo, like mongo-php-adapter.
We are happy to announce the immediate availability of Doctrine MongoDB Abstraction Layer 1.6.0.
This release fixes a BC break introduced in 1.5.0 which prevented correct conversion of expression object within aggregation builder stages.
A full list of issues and pull requests included in this release may be found in the 1.6.0 milestone.
This library requires PHP 5.6 or newer. If you are using PHP 7.0 or newer, you can use this library by adding a polyfill for ext-mongo, like mongo-php-adapter.
We are happy to announce the immediate availability of Doctrine MongoDB Abstraction Layer 1.5.0.
This release adds support for aggregation pipeline changes introduced in MongoDB. Details can be found in the changelog.
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.5.0 milestone.
This library requires PHP 5.6 or newer. If you are using PHP 7.0 or 7.1, you can use this library by adding a polyfill for ext-mongo, like mongo-php-adapter.
We are happy to announce the immediate availability of Doctrine MongoDB Abstraction Layer 1.4.0.
With this release it's possible to pass driver options to the connection class, which will then be passed on to the MongoDB driver. For example, to pass a stream context with SSL context options, you could use the following code snippet:
$context = stream_context_create([
'ssl' => [
'allow_self_signed' => false,
]
]);
$connection = new \Doctrine\MongoDB\Connection(null, [], null, null, ['context' => $context]);
The addAnd, addNor and addOr methods in the query and aggregation builders now take multiple expression objects. Instead of having to call the method repeatedly, you may call it once with multiple arguments:
// Before
$builder
->addAnd($someExpression)
->addAnd($otherExpression);
// After
$builder->addAnd($someExpression, $otherExpression);
The update and multiple methods in the query have been deprecated in favor of updateOne and updateMany. These deprecations help people using ODM prepare for the next version of ODM which will utilize the new MongoDB library API.
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.4.0 milestone.
With this release, we have dropped support for PHP 5.5. Users using PHP 5.5 or older are encouraged to upgrade to a newer PHP version. If you are using PHP 7.0 or 7.1, you can use this library by adding a polyfill for ext-mongo, like mongo-php-adapter.
This release drops compatibility with PHP 5.3 and PHP 5.4 and requires ext-mongo >= 1.5. Older driver versions are no longer supported.
Pull requests completed for the 1.3.0 release:
$comment operator$setOnInsert operatorPull requests completed for the 1.2.2 release:
Pull requests completed for the 1.2.0 release:
$minDistance query operator and geoNear optionCollection::update() "multi" option to "multiple"Connection::convertWriteTimeout() docs$meta expressions in Cursor::sort()equals()Builder::geoWithin()MongoCollection::parallelCollectionScan()$useKeys option when EagerCursor converts to an arrayCollection::count()useIdentifierKeys optionNote: This tag was previously created against the master branch (1.2.x), which means it contained new commits that did not belong in 1.1.x. It has since been revised to point to the correct commit within the 1.1.x branch and is now consistent with the changelog below. That said, this release has been superseded by 1.1.8.
Pull requests completed for the 1.1.7 release:
Connection::isConnected() for driver versions 1.5.0+Database::command()Pull requests completed for the 1.1.8 release:
Pull requests completed for the 1.0.11 release:
Pull requests completed for the 1.0.10 release:
Connection::isConnected() for driver versions 1.5.0+Pull requests completed for the 1.1.6 release:
Collection::ensureIndex() should convert write options$options when $server is null in Connection constructorcreateCollection() options for MongoDB 2.6 compatibilityPull requests completed for the 1.0.9 release:
Collection::ensureIndex() should convert write options$options when $server is null in Connection constructorPull requests completed for the 1.1.5 release:
current() in EagerCursor::getSingleResult()Pull requests completed for the 1.0.8 release:
current() in EagerCursor::getSingleResult()Pull requests completed for the 1.1.4 release:
Cursor::hint() argument"Cursor::hint() argumentNote: PR #163 was necessary for the 1.0.7 release, due to a BC break in 1.0.6. It shows up here because the 1.0.x branch was merged to master. PR #164 is the reverted change reapplied to the master branch.
Pull requests completed for the 1.0.7 release:
Cursor::hint() argument"Pull requests completed for the 1.1.3 release:
Cursor::hint() argumentEagerCursor::getSingleResult() behaviorPull requests completed for the 1.0.6 release:
Cursor::hint() argumentEagerCursor::getSingleResult() behaviorPull requests completed for the 1.1.2 release:
Cursor::getSingleResult() should not use keys in toArray()Pull requests completed for the 1.0.5 release:
Cursor::getSingleResult() should not use keys in toArray()Pull requests completed for the 1.1.1 release:
getSingleResult()Cursor::batchSize()Pull requests completed for the 1.1.0 release:
Collection::aggregate() helperBuilder::select() and exclude()Cursor::hint() and sort() should overwrite previous valuessetReadPreference() with recreate() and make it chainableQuery::TYPE_GEO_LOCATION to TYPE_GEO_NEARoffsetSet() to append valuesvalid() return value if an array element is falseCollection::update()group() now returns an ArrayIterator instead of the raw command responsemapReduce() options are prepared as MongoCode objects (where applicable)mapReduce()createDBRef() should not use array type hinting (arg can be a document or an ID)createDBRef() should not dispatch events, nor should it be loggedDatabase::getDBRef() (Collection already had this)getGridFS() and createCollection()createCollection() and make LoggableDatabase's API consistent with the base classdebug() methodsExpr::addManyToSet()Expr::each() and allow it to be used with addToSet()Expr::addManyToSet() in favor of addToSet() and each()push()Expr::push() should ensure $each operator appears firstExpr::where() should not alter the current field in the builderBuilder::mapReduceOptions() and out() methods should require mapReduce commandBuilder::geoNear() and set spherical defaultBuilder::map() should init full query array, default to inline mapReduce outputQuery::DISTINCT_FIELD to DISTINCTBuilder::all() and Expr::all()Query::getIterator() should not execute if an exception is guaranteedQuery::iterate() alias in favor of getIterator()mongoCmd optioninitialize() calls in Connection methods to avoid use of null objectsBuilder::sort() should default to ascending ordergetReadPreference() from pre-1.3.3 driversCursor::setReadPreference()Expr::mod() should take explicit divisor/remainder argsAdditional commits included in 1.1.0:
Expr::equals()Collection::batchInsert() (closes #93)Cursor::limit() argument is casted to an integerConnection::getStatus() (to be removed in 1.2)Query::TYPE_GEO_LOCATION constant for BC, but deprecate itHow can I help you explore Laravel packages today?