When modeling BulkWriteCommandResult, the operation results are BSON documents with numeric keys corresponding to the operation from the executed BulkWriteCommand. In my initial implementation of BulkWriteCommandResult, I decided to return the BSON documents directly as MongoDB\BSON\Document instances. PHPLIB can later utilize a codec to make working with these documents more convenient.
The Document ArrayAccess methods and dimension handlers have historically required a string parameter type. Allowing an integer, which is then internally cast to a string, would make accessing results more convenient when working only with PHPC. No changes will be made for the strictly-typed API (e.g. get()) or property handlers (which receive zend_string parameters).
PackedArray has similar logic that enforces an integer argument, but that can remain as-is.
- is related to
-
PHPC-2494 Model BulkWriteCommandResult and exception class
-
- In Code Review
-