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

Return BSON values from Document, PackedArray, and Iterator classes

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      PHPC-2206 introduced a BSON\Value class that was intended to make it easier to handle raw BSON values instead of dealing with PHP values that can lead to a loss of precision. Changes made during that change make it easier for us to handle that case.

      Instead of returning a BSON\Value instance, BSON\Document::get, BSON\PackedArray::get, and BSON\Iterator::current can return the underlying value (i.e. the value returned in BSON\Value::getValue), eliminating the need for special handling whenever working with raw BSON data. Since BSON\Value::getValue always returns a BSON\Int64 instance for BSON long values (even on 64-bit platforms), this resolves the original problem of losing precision.

            Assignee:
            andreas.braun@mongodb.com Andreas Braun
            Reporter:
            andreas.braun@mongodb.com Andreas Braun
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: