mongodb\Cache gc()

gc() public method Removes the expired data values. public void gc ( $force = false )$force boolean Whether to enforce the garbage collection regardless of $gcProbability. Defaults to false, meaning the actual deletion happens with the probability as specified by $gcProbability.

mongodb\Cache flushValues()

flushValues() protected method Deletes all values from cache. Child classes may implement this method to realize the flush operation. protected boolean flushValues ( )return boolean Whether the flush operation was successful.

mongodb\Cache deleteValue()

deleteValue() protected method Deletes a value with the specified key from cache This method should be implemented by child classes to delete the data from actual cache storage. protected boolean deleteValue ( $key )$key string The key of the value to be deleted return boolean If no error happens during deletion

mongodb\Cache addValue()

addValue() protected method Stores a value identified by a key into cache if the cache does not contain this key. This method should be implemented by child classes to store the data in specific cache storage. protected boolean addValue ( $key, $value, $expire )$key string The key identifying the value to be cached $value string The value to be cached $expire integer The number of seconds in which the cached value will expire. 0 means never expire. return boolean True if the value

mongodb\Cache $gcProbability

$gcProbability public property The probability (parts per million) that garbage collection (GC) should be performed when storing a piece of data in the cache. Defaults to 100, meaning 0.01% chance. This number should be between 0 and 1000000. A value 0 meaning no GC will be performed at all. public integer $gcProbability = 100

mongodb\Cache $db

$db public property The MongoDB connection object or the application component ID of the MongoDB connection. After the Cache object is created, if you want to change this property, you should only assign it with a MongoDB connection object. Starting from version 2.0.2, this can also be a configuration array for creating the object. public yii\mongodb\Connection|array|string $db = 'mongodb'

mongodb\Cache $cacheCollection

$cacheCollection public property The name of the MongoDB collection that stores the cache data. Please refer to yii\mongodb\Connection::getCollection() on how to specify this parameter. This collection is better to be pre-created with fields 'id' and 'expire' indexed. public string|array $cacheCollection = 'cache'

mongodb\BatchQueryResult valid()

valid() public method Returns whether there is a valid dataset at the current position. This method is required by the interface Iterator. public boolean valid ( )return boolean Whether there is a valid dataset at the current position.

mongodb\BatchQueryResult rewind()

rewind() public method Resets the iterator to the initial state. This method is required by the interface Iterator. public void rewind ( )

mongodb\BatchQueryResult reset()

reset() public method Resets the batch query. This method will clean up the existing batch query so that a new batch query can be performed. public void reset ( )