Enable casting BSON PackedArray and Document into (array)

XMLWordPrintableJSON

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

      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
              Reporter:
              Jérôme Tamarelle
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: