MongoCursor::doQuery PHP Method

doQuery() protected method

Execute the query
protected doQuery ( ) : void
return void
    protected function doQuery()
    {
        $options = $this->getOptions() + $this->options;
        try {
            $this->cursor = $this->collection->find(TypeConverter::fromLegacy($this->query), $options);
        } catch (\MongoDB\Driver\Exception\ExecutionTimeoutException $e) {
            throw new MongoCursorTimeoutException($e->getMessage(), $e->getCode(), $e);
        } catch (\MongoDB\Driver\Exception\Exception $e) {
            throw ExceptionConverter::toLegacy($e);
        }
    }

Usage Example

Beispiel #1
0
 /**
  * 执行查询
  * @return null
  */
 protected function doQuery()
 {
     return $this->oMongoCursor->doQuery();
 }