Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-5501

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

    • 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?

      Currently the MongoClient constructor throws and error when provided a connection string like the following 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

      Use Case

      As a... Driver Engineer
      I want... the MongoClient constructor to warn about, but accept keys with no values from connection string options
      So that... we will improve our spec compliance

      User Impact

      __ N/A 

      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
      • Add logic to to emit a warning when encountering keys with empty string values

      Testing Requirements

      Documentation Requirements

      • DOCSP ticket should be generated.

      Follow Up Requirements

      • N/A

            Assignee:
            Unassigned Unassigned
            Reporter:
            warren.james@mongodb.com Warren James
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: