Наша группа в Telegram для обмена идеями, проектами, мыслями, людьми в сфере ИТ г.Ростова-на-Дону: @it_rostov


(PECL mongo >=0.9.2)

MongoDB::command — Execute a database command


public array MongoDB::command ( array $command [, array $options = array() ] )

Almost everything that is not a CRUD operation can be done with a database command. Need to know the database version? There's a command for that. Need to do aggregation? There's a command for that. Need to turn up logging? You get the idea.

This method is identical to:

public function command($data) {
    return $this->selectCollection('$cmd')->findOne($data);

Список параметров

command -

The query to send.

options -

This parameter is an associative array of the form array("optionname" => <boolean>, ...). Currently supported options are:

  • "timeout"

    Integer, defaults to Mongo::$timeout. If "safe" is set, this sets how long (in milliseconds) for the client to wait for a database response. If the database does not respond within the timeout period, a MongoCursorTimeoutException will be thrown.

Описание класса mongodb, примеры использования класса mongodb.

Смотрите также:
Описание на ru2.php.net
Описание на php.ru