php8.5
Home/ Manual/ driver / cursorinterface/ MongoDB\Driver\CursorInterface::toArray

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

Source: reference/mongodb/mongodb/driver/cursorinterface/toarray.xml · from the official PHP manual (php/doc-en)