php8.5
Home/ Manual/ bson / packedarray/ MongoDB\BSON\PackedArray::getIterator

MongoDB\BSON\PackedArray::getIterator

PHP function Edit on GitHub ✎

(mongodb >=1.16.0)

Returns an iterator for the BSON array

Description

MongoDB\BSON\PackedArray::getIterator(): MongoDB\BSON\Iterator

Parameters Parameters

Return Values

Returns a MongoDB\BSON\Iterator instance that can be used to iterate over all indexes in the array.

Errors/Exceptions

  • Throws MongoDB\Driver\Exception\UnexpectedValueException if the BSON iterator could not be initialized.

See Also

  • BSON Types

Source: reference/mongodb/bson/packedarray/getiterator.xml · from the official PHP manual (php/doc-en)