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

URI option readPreference as integer constant value

    • Type: Icon: Task Task
    • Resolution: Works as Designed
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 1.3.0
    • Component/s: None
    • None
    • Environment:

      I try create object \MongoDB\Client with
      $uriOptions['readPreference'] = \MongoDB\Driver\ReadPreference::RP_PRIMARY;

      I have exception \MongoDB\Exception\InvalidArgumentException with message "Expected string for "readPreference" URI option, 32-bit integer given".

      It was work for previous versions.

      I suggest allow pass for readPreference option integer mode from class http://php.net/manual/ru/mongodb-driver-readpreference.construct.php

            Assignee:
            Unassigned Unassigned
            Reporter:
            alexpts Alex Pts
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: