« MongoDB\BSON\Iterator::current
MongoDB\BSON\Iterator::next »

MongoDB\BSON\Iterator::key

(mongodb >=1.16.0)

MongoDB\BSON\Iterator::key — Returns the key of the current element

説明

public function MongoDB\BSON\Iterator::key(): string|int

パラメータ

この関数にはパラメータはありません。

戻り値

Returns the key of the current element. When iterating a BSON document, the key will always be a string. When iterating a BSON array, the key will be an int.

エラー / 例外

参考

関連キーワード:
MongoDB   Iterator   current   element   iterating   Throws   Driver   Exception   next   mongodb   document   always   InvalidArgumentException   argument   parsing   errors   LogicException   iterator   valid   参考   キー
関連する関数・ページ:
mongodb-bson-iterator.current   class.mongodb-bson-iterator   mongodb-bson-iterator.rewind   mongodb-bson-iterator.next   iterator.current   mongodb-bson-iterator.construct