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

Long.fromString coerces valid inputs to 'Long.ZERO'

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • bson-6.7.0
    • Affects Version/s: None
    • Component/s: None
    • 2
    • Not Needed
    • Not Needed
    • 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?

      Use Case

      As a... BSON user
      I want... valid numeric inputs to Long.fromString to not be coerced
      So that... my data isn't corrupted

      Acceptance Criteria

      Implementation Requirements

      • when radix is >=24, and input is 'NaN' return numeric value
        • ex: in radix 26, 'NaN' represents 17060 in decimal
      • when radix is >=35 and input is '+Infinity', '-Infinity', or 'Infinity', return numeric value
      • otherwise with 'NaN', '+Infinity', '-Infinity', or 'Infinity' inputs, coerce to Long.ZERO

      Testing Requirements

      • add unit tests for +Infinity, -Infinity, Infinity, with radixes <35 and >=35
      • add unit tests for NaN, with radixes < 24 and >=24 

            Assignee:
            aditi.khare@mongodb.com Aditi Khare
            Reporter:
            aditi.khare@mongodb.com Aditi Khare
            Warren James
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: