Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-49

withOptions() method for cloning immutable Database and Collection objects

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.0.0-beta2
    • Affects Version/s: None
    • Component/s: None
    • None

      Changing the write concern or read preference should return a new object with the applied preferences.

      For example, Collection::withOptions(['readPreference' => ...]) should create a new Collection object with the same Manager but a new default read preference. This is similar to what behackett is doing in the Python driver (see with_options).

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: