By default, Cache stores session data in a MongoDB collection named 'cache' inside the default database. This collection is better to be pre-created with fields 'id' and 'expire' indexed. The collection name can be changed by setting [[cacheCollection]]. Please refer to Cache for common cache operations that are supported by Cache. The following example shows how you can configure the application to use Cache: php 'cache' => [ 'class' => 'yii\mongodb\Cache', 'db' => 'mymongodb', 'cacheCollection' => 'my_cache', ]
Since: 2.0
Author: Paul Klimov (klimov.paul@gmail.com)
Inheritance: extends yii\caching\Cache
 /**
  * Creates test cache instance.
  * @return Cache cache instance.
  */
 protected function createCache()
 {
     return Yii::createObject(['class' => Cache::className(), 'db' => $this->getConnection(), 'cacheCollection' => static::$cacheCollection, 'gcProbability' => 0]);
 }