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

Enable casting BSON PackedArray and Document into (array)

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

      data is casted with native PHP cast feature in Laravel code: (object) $result and (array) $result.

      Note that we could leverage the cast_object object handler in extension classes to facilitate converting a PackedArray into an array.

      https://github.com/mongodb/laravel-mongodb/pull/3107#issuecomment-2309658318

       

      This would be useful for MongoDB\BSON\PackedArray and MongoDB\BSON\Document.

      But, I'm not sure we can implement it for PHPLIB classes 
      MongoDB\Model\BSONDocument and MongoDB\Model\BSONArray

            Assignee:
            Unassigned Unassigned
            Reporter:
            jerome.tamarelle@mongodb.com Jérôme Tamarelle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: