MongoDB\Driver\CursorInterface::toArray
PHP function
Edit on GitHub ✎
(mongodb >=1.6.0)
Returns an array containing all results for this cursor
Description
MongoDB\Driver\CursorInterface::toArray(): array
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.
Parameters Parameters
Return Values
Returns an array containing all results for this cursor.
Errors/Exceptions
See Also
MongoDB\Driver\Cursor::toArrayMongoDB\Driver\CursorInterface::setTypeMap()