mongodb\Collection distinct()

distinct() public method Returns a list of distinct values for the given column across a collection. public array|boolean distinct ( $column, $condition = [], $options = [] )$column string Column to use. $condition array Query parameters. $options array List of options in format: optionName => optionValue. return array|boolean Array of distinct values, or "false" on failure. throws yii\mongodb\Exception on failure.

mongodb\Collection count()

count() public method (available since version 2.1) Counts records in this collection. public integer count ( $condition = [], $options = [] )$condition array Query condition $options array List of options in format: optionName => optionValue. return integer Records count.

mongodb\Collection $fullName

$fullName public read-only property Full name of this collection, including database name. public string getFullName ( )

mongodb\Collection $name

$name public property Name of this collection. public string $name = null

mongodb\Collection aggregate()

aggregate() public method Performs aggregation using Mongo Aggregation Framework. public array aggregate ( $pipelines, $options = [] )$pipelines array List of pipeline operators. $options array Optional parameters. return array The result of the aggregation. throws yii\mongodb\Exception on failure.

mongodb\Collection batchInsert()

batchInsert() public method Inserts several new rows into collection. public array batchInsert ( $rows, $options = [] )$rows array Array of arrays or objects to be inserted. $options array List of options in format: optionName => optionValue. return array Inserted data, each row will have "_id" key assigned to it. throws yii\mongodb\Exception on failure.

mongodb\Collection $database

$database public property MongoDB database instance. public yii\mongodb\Database $database = null

mongodb\Cache setValue()

setValue() protected method Stores a value identified by a key in cache. This method should be implemented by child classes to store the data in specific cache storage. protected boolean setValue ( $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 is successfully stored into cache, false

mongodb\Cache init()

init() public method Initializes the Cache component. This method will initialize the $db property to make sure it refers to a valid MongoDB connection. public void init ( )throws yii\base\InvalidConfigException if $db is invalid.

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.