Accept empty values for boolean and integer keys from connection string options

XMLWordPrintableJSON

    • Not Needed
    • 🔵 Done
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Use Case

      As a... Driver Engineer
      I want... the MongoClient constructor to warn about, but accept keys with no values from connection string options if the keys are not an array option (i.e., readPreferenceTags)
      So that... we will improve our spec compliance.


      Currently the MongoClient constructor throws an error when provided a connection string where one or more options is provided an empty string:

      mongodb://localhost:27017/?key0=&key1=someString

      The spec expects that the options would be parsed to this option object:

      {
        key0: '',
        key1: 'someString'
      }
      

      Also note that when parsing the connection string, the spec considers the key to include the first '='. i.e. this would not be valid according to the spec.

      mongodb://localhost:27017/?key0&key1=someString

      This is not accurate: https://github.com/mongodb/specifications/blob/master/source/connection-string/connection-string-spec.md#key-value-pair


      User Impact

      • Users will receive a warning, not an error, if they provide a URI with k-v pair with no value.
         

        Dependencies

      • TBD based on answers to unknowns

      Unknowns

      • how would this change affect shell?

      Acceptance Criteria

      Implementation Requirements

      • Remove logic that throws when encountering keys with empty string values from connection string if the key is not an array option
      • Add logic to to emit a warning when encountering keys with empty string values if the key is not an array option

      Testing Requirements

      Documentation Requirements

      • DOCSP ticket should be generated.
      • Add example to release notes

      Follow Up Requirements

      • N/A

            Assignee:
            Unassigned
            Reporter:
            Warren James (Inactive)
            None
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: