-
Type: Sub-task
-
Resolution: Gone away
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
__isset and offsetExists calls use the has method, which internally advances the iterator until the desired key is found in the BSON structure. If a user subsequently wants to read the value, the iteration has to happen again. Using get to read the value (without decoding it and only keeping raw BSON) would reduce this double iteration while still being memory efficient.
https://github.com/mongodb/mongo-php-library/pull/1135#discussion_r1273881215