CursorInterface
interface CursorInterface implements Traversable (View source)
This interface is implemented by MongoDB\Driver\Cursor but may also be used for type-hinting and userland classes.
Methods
Returns the cursor ID associated with this cursor. A cursor ID uniquely identifies the cursor on the server.
Checks whether the cursor may have additional results available to read.
Sets a type map to use for BSON unserialization
Iterates the cursor and returns its results in an array.
Details
Int64
getId()
Returns the cursor ID associated with this cursor. A cursor ID uniquely identifies the cursor on the server.
Server
getServer()
Returns the MongoDB\Driver\Server associated with this cursor.
This is the server that executed the MongoDB\Driver\Query or MongoDB\Driver\Command.
bool
isDead()
Checks whether the cursor may have additional results available to read.
void
setTypeMap(array $typemap)
Sets a type map to use for BSON unserialization
array
toArray()
Iterates the cursor and returns its results in an array.
MongoDB\Driver\CursorInterface::setTypeMap() may be used to control how documents are unserialized into PHP values.