Uploaded image for project: 'PHP Legacy Driver'
  1. PHP Legacy Driver
  2. PHP-358

Explicit type [array/map] definition to save php arrays (if empty or integer-indexed)

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • # Replies:
      3
    • Last comment by Customer:
      false

      Description

      PHP api to save empty php array or array(0=>'0',1=>'1',2=>'2'...) as object/map, not an array.
      Currently:
      array() => []
      array(0=>'0',1=>'1') => ["0","1"] *really didn't check this case
      I want the way to save it like:
      array() => {}
      array(0=>'0',1=>'1') =>

      {0:"0",1:"1"}

      May be it can be done with something like class MongoMap{ function __construct(array $src=array()){...}}
      Or, at least, configuration option to bson serializer to force map for empty arrays.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since reply:
                  4 years, 49 weeks, 1 day ago
                  Date of 1st Reply: