Home
My Account
About us
Products
Support Services
Buy online
Downloads
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
PHP Manual
MongoDB\BSON
Functions
MongoDB\BSON\Document
MongoDB\BSON\PackedArray
MongoDB\BSON\Iterator
MongoDB\BSON\Binary
MongoDB\BSON\VectorType
MongoDB\BSON\Decimal128
MongoDB\BSON\Javascript
MongoDB\BSON\MaxKey
MongoDB\BSON\MinKey
MongoDB\BSON\ObjectId
MongoDB\BSON\Regex
MongoDB\BSON\Timestamp
MongoDB\BSON\UTCDateTime
MongoDB\BSON\Type
MongoDB\BSON\Persistable
MongoDB\BSON\Serializable
MongoDB\BSON\Unserializable
MongoDB\BSON\BinaryInterface
MongoDB\BSON\Decimal128Interface
MongoDB\BSON\JavascriptInterface
MongoDB\BSON\MaxKeyInterface
MongoDB\BSON\MinKeyInterface
MongoDB\BSON\ObjectIdInterface
MongoDB\BSON\RegexInterface
MongoDB\BSON\TimestampInterface
MongoDB\BSON\UTCDateTimeInterface
MongoDB\BSON\DBPointer
MongoDB\BSON\Int64
MongoDB\BSON\Symbol
MongoDB\BSON\Undefined
MongoDB\BSON\PackedArray::__toString
MongoDB\BSON\Iterator::__construct
MongoDB\BSON
Last updated: Mon, 26 Oct 2026
The MongoDB\BSON\Iterator class
(mongodb >=1.16.0)
Introduction
Iterator used to iterate a BSON document or array.
Class synopsis
final
class
MongoDB\BSON\Iterator
implements
Iterator
{
/* Methods */
final
private
function
__construct
()
public
function
current
():
mixed
public
function
key
():
string
|
int
public
function
next
():
void
public
function
rewind
():
void
public
function
valid
():
bool
}
Table of Contents
MongoDB\BSON\Iterator::__construct
— Construct a new BSON iterator (unused)
MongoDB\BSON\Iterator::current
— Returns the current element
MongoDB\BSON\Iterator::key
— Returns the key of the current element
MongoDB\BSON\Iterator::next
— Advances the iterator to next element
MongoDB\BSON\Iterator::rewind
— Rewinds the Iterator to the first element
MongoDB\BSON\Iterator::valid
— Checks if current position is valid
MongoDB\BSON\PackedArray::__toString
MongoDB\BSON\Iterator::__construct
MongoDB\BSON
Last updated: Mon, 26 Oct 2026