• Type: Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • bson-6.0.0
    • Affects Version/s: None
    • Component/s: None
    • 0
    • Needed
    • Needed
    • Hide

      1. What would you like to communicate to the user about this feature?

      The Binary BSON type no longer accepts a string as a constructor argument.

      Binary.write can no longer be invoked with a string argument
      2. Would you like the user to see examples of the syntax and/or executable code and its output?

      See example in Release Highlights https://github.com/mongodb/js-bson/pull/602

      3. Which versions of the driver/connector does this apply to?
      bson >= 6.0, driver >= 6.0

      Show
      1. What would you like to communicate to the user about this feature? The Binary BSON type no longer accepts a string as a constructor argument. Binary.write can no longer be invoked with a string argument 2. Would you like the user to see examples of the syntax and/or executable code and its output? See example in Release Highlights https://github.com/mongodb/js-bson/pull/602 3. Which versions of the driver/connector does this apply to? bson >= 6.0, driver >= 6.0

      AC

      • Audit all usages of 'binary', 'latin1', and 'ascii' as encodings for constructing a node buffer.
      • Binary
        • Within the constructor remove creating a buffer from the 'binary' encoding (Buffer.from(buffer, 'binary');).
        • Open question do we remove support for string inputs? Or do we want to instead change the encoding to utf8? Answer: no we are going to disallow strings as input.
        • Add a condition to detect string input and throw a meaningful message. (without this string should still crash due to the constructor only expecting Buffer inputs)
      • Remove ISO-8859-1 string format support from Binary class methods and constructor
      • Update tests

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Warren James
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: