Cursor
final class Cursor implements CursorInterface, Iterator (View source)
The MongoDB\Driver\Cursor class encapsulates the results of a MongoDB command or query and may be returned by MongoDB\Driver\Manager::executeCommand() or MongoDB\Driver\Manager::executeQuery(), respectively.
Methods
No description
Returns the current element.
Returns the cursor ID associated with this cursor. A cursor ID cursor uniquely identifies the cursor on the server.
Returns the MongoDB\Driver\Server associated with this cursor. This is the server that executed the query or command.
Checks if a cursor is still alive
Returns the current result's index within the cursor.
Advances the cursor to the next result.
Rewind the cursor to the first result.
Sets a type map to use for BSON unserialization
Returns an array of all result documents for this cursor
Checks if the current position in the cursor is valid.
Details
final
__wakeup()
No description
mixed
current()
Returns the current element.
final Int64
getId(bool $asInt64 = false)
Returns the cursor ID associated with this cursor. A cursor ID cursor uniquely identifies the cursor on the server.
Receiving a CursorId return type is deprecated and will be removed in 2.0.
final Server
getServer()
Returns the MongoDB\Driver\Server associated with this cursor. This is the server that executed the query or command.
final bool
isDead()
Checks if a cursor is still alive
mixed
key()
Returns the current result's index within the cursor.
void
next()
Advances the cursor to the next result.
void
rewind()
Rewind the cursor to the first result.
final void
setTypeMap(array $typemap)
Sets a type map to use for BSON unserialization
final array
toArray()
Returns an array of all result documents for this cursor
bool
valid()
Checks if the current position in the cursor is valid.