mongodb\Connection $defaultDatabaseName

$defaultDatabaseName public property Default database name. public string getDefaultDatabaseName ( )public void setDefaultDatabaseName ( $name )

mongodb\Connection $database

$database public read-only property Database instance. public yii\mongodb\Database getDatabase ( $name = null, $refresh = false )

mongodb\Command update()

update() public method Update existing documents in the collection. public \MongoDB\Driver\WriteResult update ( $collectionName, $condition, $document, $options = [] )$collectionName string Collection name $condition array Filter condition $document array Data to be updated. $options array Update options. return \MongoDB\Driver\WriteResult Write result.

mongodb\Command setWriteConcern()

setWriteConcern() public method Sets write concern for this command. public $this setWriteConcern ( $writeConcern )$writeConcern \MongoDB\Driver\WriteConcern|integer|string|null Write concern, it can be an instance of \MongoDB\Driver\WriteConcern or its scalar mode value, for example: majority. return $this Self reference

mongodb\Command setReadPreference()

setReadPreference() public method Sets read preference for this command. public $this setReadPreference ( $readPreference )$readPreference \MongoDB\Driver\ReadPreference|integer|string|null Read reference, it can be specified as instance of \MongoDB\Driver\ReadPreference or scalar mode value, for example: ReadPreference::RP_PRIMARY. return $this Self reference.

mongodb\Command setReadConcern()

setReadConcern() public method Sets read concern for this command. public $this setReadConcern ( $readConcern )$readConcern \MongoDB\Driver\ReadConcern|string Read concern, it can be an instance of \MongoDB\Driver\ReadConcern or scalar level value, for example: 'local'. return $this Self reference

mongodb\Command query()

query() public method Executes this command as a mongo query public \MongoDB\Driver\Cursor query ( $collectionName, $options = [] )$collectionName string Collection name $options array Query options. return \MongoDB\Driver\Cursor Result cursor. throws yii\mongodb\Exception on failure

mongodb\Command mapReduce()

mapReduce() public method Performs MongoDB "map-reduce" command. public string|array mapReduce ( $collectionName, $map, $reduce, $out, $condition = [], $options = [] )$collectionName string Collection name. $map \MongoDB\BSON\Javascript|string Function, which emits map data from collection. Argument will be automatically cast to \MongoDB\BSON\Javascript. $reduce \MongoDB\BSON\Javascript|string Function that takes two arguments (the map key and the map values) and does the aggregati

mongodb\Command log()

log() protected method Logs the command data if logging is enabled at $db. protected string|false log ( $namespace, $data, $category )$namespace array|string Command namespace. $data array Command data. $category string Log category return string|false Log token, false if log is not enabled.

mongodb\Command listIndexes()

listIndexes() public method Returns information about current collection indexes. public array listIndexes ( $collectionName, $options = [] )$collectionName string Collection name $options array List of options in format: optionName => optionValue. return array List of indexes info. throws yii\mongodb\Exception on failure.