MongoCommandCursor
PHP Manual

MongoCommandCursor::rewind

(No version information available, might only be in Git)

MongoCommandCursor::rewindExecutes the command and resets the cursor to the start of the result set

Description

public array MongoCommandCursor::rewind ( void )

Parameters

This function has no parameters.

Return Values

The raw server result document.


array(2) {
["cursor"]=>
array(3) {
["id"]=>
object(MongoInt64)#5 (1) {
["value"]=>
string(12) "310050110216"
}
["ns"]=>
string(9) "demo.test"
["firstBatch"]=>
array(1) {
[0]=>
array(2) {
["_id"]=>
object(MongoId)#6 (1) {
["$id"]=>
string(24) "52f5691544670a8077b0dc51"
}
["value"]=>
string(2) "42"
}
}
}
["ok"]=>
float(1)
}

Errors/Exceptions

Throws MongoConnectionException if it cannot reach the database and MongoCommandCursorTimeoutException if the timeout is exceeded.


MongoCommandCursor
PHP Manual