This extension provides the MongoDB integration for the Yii framework 2.0.
For license information check the LICENSE-file.
Documentation is at https://github.com/yiisoft/yii2-mongodb/blob/master/docs/guide/README.md.
This extension requires MongoDB PHP Extension version 1.0.0 or higher.
This extension requires MongoDB server version 3.0 or higher.
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist yiisoft/yii2-mongodb
or add
"yiisoft/yii2-mongodb": "~3.0.0"
to the require
section of your composer.json
.
To use this extension, simply add the following code in your application configuration:
return [
//....
'components' => [
'mongodb' => [
'class' => '\yii\mongodb\Connection',
'dsn' => 'mongodb://localhost:27017/mydatabase',
'options' => [
"username" => "Username",
"password" => "Password"
]
],
],
];
trim
validator and strtolower
causes exception in PHP 8.1 (dorkdomain)ActiveQuery::Each()
(ziaratban)batchSize
cursor option in application level according to jira.mongodb(PHP-457) (ziaratban)random_int()
for cache garbage collection (samdark)yii\mongodb\BatchQueryResult
to be compatible with PECL MongoDb 1.9.0 driver (bizley)yii\mongodb\file\Upload::addFile()
error when uploading file with readonly permissions (sparchatus)yii\web\Session
(rhertogh)Collection::dropAllIndexes()
error when no indexes were dropped (samdark)sessionWrite
callback fields (related to https://github.com/yiisoft/yii2/issues/17559 and https://github.com/yiisoft/yii2/pull/17188) (lubosdz)yii\mongodb\ActiveQuery::indexBy()
does not apply while using Yii 2.0.14 (klimov-paul)yii\mongodb\Session
now relies on error handler to display errors (samdark)yii\mongodb\Command::aggregate()
without 'cursor' option produces error on MongoDB Server 3.6 (Lisio, klimov-paul)yii\mongodb\Collection::dropIndex()
unable to drop index specified with sort via index plugin (klimov-paul)yii\base\Object
changed to yii\base\BaseObject
allowing compatibility with PHP 7.2 (klimov-paul)yii\mongodb\file\Collection::remove()
does not removes all file chunks in case limit
is specified (klimov-paul)yii\mongodb\Command::aggregate()
does not support 'cursor' option (klimov-paul)yii\mongodb\Migration::$compact
supporting yii\console\controllers\BaseMigrateController::$compact
option (klimov-paul)yii\mongodb\i18n\MongoDbMessageSource
changed avoiding usage message key as BSON key (klimov-paul)yii\mongodb\rbac\MongoDbManager::invalidateCache()
invocation (jafaripur)yii\mongodb\Command
(KhristenkoYura)yii\mongodb\Query::limit()
or yii\mongodb\Query::offset()
does not disables query limit or offset correspondingly (klimov-paul)yii\mongodb\validators\MongoDateValidator
corrupts date value, while validating existing MongoDB\BSON\UTCDateTime
instance (klimov-paul)yii\mongodb\debug\MongoDbPanel
overrides explain action of yii\debug\panels\DbPanel
(Liv1020, klimov-paul)MigrateController
compatible with Yii 2.0.12 (cebe)yii\mongodb\Command::update()
uses upsert
option by default (klimov-paul)yii\mongodb\console\controllers\MigrateController::$migrationNamespaces
is in use (klimov-paul)yii\mongodb\ActiveQuery
does not respects relational link at methods count()
, distinct()
, sum()
, average()
, modify()
(tuyakhov, klimov-paul)yii\mongodb\validators\MongoDateValidator
uses seconds instead of milliseconds while creating MongoDB\BSON\UTCDateTime
instance (reza-id, klimov-paul)yii\mongodb\file\Upload
unable to handle custom _id
value, if it does not provided as \MongoDB\BSON\ObjectID
instance (klimov-paul)yii\mongodb\rbac\MongoDbManager::getRolesByUser()
results now includes default roles (klimov-paul)yii\db\QueryInterface::emulateExecution()
to force returning an empty result for a query (klimov-paul)yii\mongodb\ActiveQuery::exists()
optimized avoiding redundant ActiveRecord and relations population (klimov-paul)yii\mongodb\Query::exists()
always returning true (klimov-paul)yii\mongodb\Query
unable to process not
condition with null
compare value (klimov-paul)yii\mongodb\rbac\MongoDbManager::getChildRoles()
method allowing finding child roles for the given one (githubjeka, klimov-paul)scalar()
and column()
added to yii\mongodb\Query
(klimov-paul)yii\mongodb\Collection::findOne()
returns false
instead of null
on empty result (klimov-paul)yii\mongodb\Migration::createIndexes()
triggers E_NOTICE (klimov-paul)yii\mongodb\ActiveFixture
fails to find default data file if collectionName
is specified in array format (klimov-paul)yii\mongodb\ActiveRecord
and yii\mongodb\file\ActiveRecord
looses _id
custom value on insertion (lxyfirst, klimov-paul)stream_seek
and stream_tell
to yii\mongodb\file\StreamWrapper
for fseek()
and ftell()
(AstRonin)yii\mongodb\Migration::listCollections()
method (klimov-paul)yii\mongodb\ActiveRecord::toArray()
provides better representation for BSON objects in recursive mode (klimov-paul, rowdyroad)yii\mongodb\ActiveFixture
throws exception on empty fixture data (darkunz)yii\mongodb\Collection::buildInCondition()
unable to process composite 'IN' condition (klimov-paul)yii\mongodb\Collection::distinct()
always returns false
on empty condition for MongoDB 2.8 (boxoft)yii\mongodb\Collection::buildCondition()
does not compose 'IN' condition for the values with broken index sequence (klimov-paul)yii\mongodb\Query
(raoptimus)yii\mongodb\Query
now contains a andFilterCompare()
method that allows filtering using operators in the query value (lennartvdd)yii\mongodb\Session
(klimov-paul)yii\mongodb\Query
(klimov-paul)yii\mongodb\Query
(klimov-paul)yii\mongodb\Collection::buildInCondition
is not added '$in' for array contains one element (webdevsega)yii\mongodb\Connection::driverOptions
allowing setup of the options for the MongoDB driver (klimov-paul)yii\mongodb\i18n\MongoDbMessageSource
(klimov-paul)MongoDbPanel
debug panel (webdevsega)yii\mongodb\rbac\MongoDbManager
(klimov-paul)MongoDbTarget
now uses batchInsert()
while exporting log messages (klimov-paul)yii\mongodb\Query::one()
fails on PHP MongoDB extension version 1.6.x (im-kulikov, klimov-paul)yii\mongodb\validators\MongoIdValidator
and yii\mongodb\validators\MongoDateValidator
validators (klimov-paul)yii\mongodb\Collection
(klimov-paul)yii\mongodb\Query::select
now allows excluding fields (Sammaye, klimov-paul)yii\mongodb\file\ActiveRecord
(klimov-paul)yii\mongodb\ActiveRecord
saves null
as _id
, if attributes are empty (klimov-paul)yii\mongodb\Query
and yii\mongodb\ActiveQuery
(klimov-paul)yii\mongodb\Collection
unable to fetch default database name from DSN with parameters (klimov-paul)yii\mongodb\ActiveRecord
unable to fetch 'hasMany' referred by array of \MongoId
(klimov-paul)yii\mongodb\Collection::buildLikeCondition()
fixed to escape regular expression (klimov-paul)yii\mongodb\Collection::buildInCondition()
handles non-sequent key arrays (klimov-paul)unlinkAll()
-method to active record to remove all records of a model relation (NmDimas, samdark, cebe)init
event to ActiveQuery
classes (qiangxue)yii\mongodb\log\MongoDbTarget
log target added (klimov-paul)
Comments