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

MongoCursor::doQuery

(Информация о версии неизвестна, возможно, только в SVN)

MongoCursor::doQuery — Execute the query.


Описание

protected void MongoCursor::doQuery ( void )

This function actually queries the database. All queries and commands go through this function. Thus, this function can be overridden to provide custom query handling.

This handles serializing your query, sending it to the database, receiving a response, and deserializing it. Thus, if you are planning to override this, your code should probably call out to the original to use the existing functionality (see the example below).


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

У этой функции нет параметров.


Возвращаемые значения

NULL.


Ошибки

Throws MongoConnectionException if it cannot reach the database.


Примеры

Пример #1 MongoCursor::doQuery() example

You could override this function to attempt a query on a slave and, if that fails, try it again on the master.


class MyCursor extends MongoCursor {
    protected function doQuery() {
        $this->slaveOkay();
        try {
            MongoCursor::doQuery();
        }
        catch(MongoCursorException $e) {
            $this->slaveOkay(false);
            MongoCursor::doQuery();
        }
    }
}


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



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