php8.5
Home/ Manual/ bson / document/ MongoDB\BSON\Document::getIterator

MongoDB\BSON\Document::getIterator

PHP function Edit on GitHub ✎

(mongodb >=1.16.0)

Returns an iterator for the BSON document

Description

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

Parameters Parameters

Return Values

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

Errors/Exceptions

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

See Also

  • BSON Types

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