# The MongoCursorInterface interface

(PECL mongo >=1.5.0)

## はじめに

Interface for cursors, which can be used to iterate through results of a database query or command. This interface is implemented by the MongoCursor and MongoCommandCursor classes.

> 注意: Similar to Traversable, this interface cannot be implemented in PHP scripts.

## クラス概要

MongoCursorInterface extends Iterator {
/* メソッド */
abstract public batchSize ( int `$batchSize` ) : MongoCursorInterface
abstract public dead ( void ) : bool
abstract public getReadPreference ( void ) : array
abstract public info ( void ) : array
abstract public setReadPreference ( string `$read_preference` [, array `$tags` ] ) : MongoCursorInterface
abstract public timeout ( int `$ms` ) : MongoCursorInterface
/* 継承したメソッド */
abstract public Iterator::current ( void ) : mixed
abstract public Iterator::key ( void ) : scalar
abstract public Iterator::next ( void ) : void
abstract public Iterator::rewind ( void ) : void
abstract public Iterator::valid ( void ) : bool
}

## 目次

- MongoCursorInterface::batchSize — Limits the number of elements returned in one batch
- MongoCursorInterface::dead — Checks if there are results that have not yet been sent from the database
- MongoCursorInterface::getReadPreference — Get the read preference for this query
- MongoCursorInterface::info — Gets information about the cursor's creation and iteration
- MongoCursorInterface::setReadPreference — Set the read preference for this query
- MongoCursorInterface::timeout — Sets a client-side timeout for this query