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

Document and PackedArray classes to represent raw BSON data

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.16.0
    • Affects Version/s: 0.6.3
    • Component/s: None
    • None

      A buffer class to compose a raw bson_t struct could be useful. When dealing with large response documents, this class (when combined with PHPC-315) could allow users to decode only as much BSON (into PHP values) as they need and leave large arrays or embedded documents as raw BSON data.

      At a glance, the class might have the following API:

      • BsonBuffer::__construct($bson)
      • BsonBuffer::toPHP(): mixed
      • static BsonBuffer::fromPHP($value): BsonBuffer

      Additionally, we should consider how this class could be used for a lazy array/document class that decodes BSON data as needed (perhaps related to PHPC-324).

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

              Created:
              Updated:
              Resolved: