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

Decimal128() input validation error

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: BSON
    • Labels:

      Use Case

      When Decimal128 is passed an integer rather than a string, instead of returning a type error, it seems to try and fail some copy operation. Either the input validation is incorrect or the error message is misleading.

       

      Example:
      Enterprise rs0 [direct: primary]> db.collection.find( { "value": Decimal128(12345.00) } )
      TypeError: value.bytes.copy is not a function

      Enterprise rs0 [direct: primary]> db.collection.find( { "value": Decimal128("12345.00") } )
      [ { _id: 3, value: Decimal128("12345.00"), expType: 'Decimal128' } ]
       

      Dependencies

      • mongosh 

      Unknowns

      Acceptance Criteria

      Implementation Requirements
      • functional reqs, potential snafus to avoid, performance targets, etc
      Testing Requirements
      • unit test, spec test sync, etc
      Documentation Requirements
      • DOCSP ticket, API docs, etc
      Follow Up Requirements
      • additional tickets to file, required releases, etc

            Assignee:
            Unassigned Unassigned
            Reporter:
            dave.cuthbert@mongodb.com Dave Cuthbert (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: