Throw exceptions for unexpected types in URI options array

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • 1.3.0-beta1, 1.3.0
    • Affects Version/s: 1.2.2
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently, the driver ignores unexpected types in the URI options array (e.g. if a ReadPreference object is passed to readPreference instead of a string value). It would be more helpful to users if we threw exceptions on unexpected types instead of silently ignoring options.

      Generic boolean options (e.g. "ssl") are currently cast via bson_iter_as_bool(), so we will continue to accept all values for such options to preserve BC (see: PHPC-990). However, boolean options for read preferences and write concerns (e.g. "slaveOk", "journal") that were previously ignored due to an unexpected type will now throw.

            Assignee:
            Jeremy Mikola
            Reporter:
            Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: