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

Document caveats of serializing BSON document to arrays with type maps

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.4.1
    • Affects Version/s: 1.0.0-beta2
    • Component/s: Docs

      It'd be helpful if we thoroughly documented some caveats with the legacy driver's approach of converting BSON documents to arrays (which is still possible in the new driver, albeit not the default).

      At the very least, we should discuss the edge case where the driver cannot reliably infer if ['0' => 'foo'] should be serialized back to a BSON document or array. Additionally, we can discuss some best practices for using classes for BSON documents and arrays in the driver's type maps, which can allow users the convenience of ArrayAccess (for objects and/or arrays) without sacrificing any type preservation.

            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:
              Resolved: