Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-2498

Accept integer types in Document::offsetGet()

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • PHP Drivers

      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 the BSON documents directly as MongoDB\BSON\Document instances. PHPLIB can later utilize a codec to make working with these documents more convenient.

      Document::offsetGet() has 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.

      PackedArray::offsetGet() has similar logic that enforces an integer argument, but that can remain as-is.

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: