mongodb\Collection createIndex()

createIndex() public method Creates an index on the collection and the specified fields. public boolean createIndex ( $columns, $options = [] )$columns array|string Column name or list of column names. If array is given, each element in the array has as key the field name, and as value either 1 for ascending sort, or -1 for descending sort. You can specify field using native numeric key with the field name as a value, in this case ascending sort will be used. For example: [ 'name',

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 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 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 $name

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

mongodb\Collection $fullName

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

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 getValue()

getValue() protected method Retrieves a value from cache with a specified key. This method should be implemented by child classes to retrieve the data from specific cache storage. protected string|boolean getValue ( $key )$key string A unique key identifying the cached value return string|boolean The value stored in cache, false if the value is not in the cache or expired.