Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<MongoDB\Driver\CursorInterface::setTypeMapMongoDB\Driver\Server>
^MongoDB\Driver\CursorInterfaceLast updated: Mon, 26 Oct 2026

MongoDB\Driver\CursorInterface::toArray

(mongodb >=1.6.0)

MongoDB\Driver\CursorInterface::toArray — Returns an array containing all results for this cursor

Description

abstract public function 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

This function has no parameters.

Return Values

Returns an array containing all results for this cursor.

Errors/Exceptions

See Also


<MongoDB\Driver\CursorInterface::setTypeMapMongoDB\Driver\Server>
^MongoDB\Driver\CursorInterfaceLast updated: Mon, 26 Oct 2026