!!!IMPORTANT!!!
The following upgrading instructions are cumulative. That is, if you want to upgrade from version A to version C and there is version B between A and C, you need to following the instructions for both A and B.
-
PHP mongodb extension is now used instead of mongo. Make sure you have 'mongodb' extension at your environment. Some features based on old driver may become unavailable. In particular: fields
Connection::mongoClient
,Database::mongoDb
andCollection::mongoCollection
are no longer exist. Old driver type classes such as\MongoId
,\MongoCode
,\MongoDate
and so on, are no longer returned or recognized. Make sure you are using their analogs from\MongoDB\BSON\*
namespace. -
MongoDB server versions < 3.0 are no longer supported. Make sure you are running MongoDB server >= 3.0
-
The signature of the following
\yii\mongodb\Collection
methods has been changed:aggregate()
,distinct()
,find()
,findOne()
,findAndModify()
. Make sure you invoke those methods correctly. In case you are extending\yii\mongodb\Collection
, you should check, if overridden methods match parent declaration. -
Command and query composition methods at
\yii\mongodb\Collection
, such asbuildCondition()
,ensureMongoId()
and so on, have been removed. Use\yii\mongodb\QueryBuilder
methods instead. -
Method
Database::executeCommand()
has been removed. UseCommand
class for plain MongoDB command execution. You may create command with database scope usingDatabase::createCommand()
method. -
Method
Collection::fullTextSearch()
has been removed. Use$text
query condition instead. -
Method
Collection::getName()
has been removed. UseCollection::name
in order to get collection self name. -
For GridFS
yii\mongodb\file\Download
is returned instead of\MongoGridFSFile
for the query result set. -
Cursor composed via
yii\mongodb\file\Collection::find()
now returns result in the same format asyii\mongodb\file\Query::one()
. If you wish to perform file manipulations on returned row you should usefile
key instead of direct method invocations.
- MongoDB PHP extension min version raised up to 1.5.0. You should upgrade your environment in case you are using older version.
- MongoDB PHP extension min version raised up to 1.4.0. You should upgrade your environment in case you are using older version.