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

Support BigInt serialization in js-bson

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • bson-5.0.0
    • Affects Version/s: None
    • Component/s: None
    • Not Needed

      Use Case

      As a driver engineer
      I want to add BigInt serialization to js-bson
      So that users can make use of native JS BigInts

      Unknowns

      • Should there be a separate helper method (e.g.: serializeBigInt) or should this be rolled into serializeNumber?
        • separate helper method should be chosen as it will allow for easier implementation of the useBigInt64 flag later on
        • since we want to add the useBigInt64 flag later, this means that we cannot serialize to BigInt by default. What is the recommended way of exposing the private helper function for testing without modifying the public API?
          • Disregard. the flag only becomes useful when dealing with deserialization.

      Acceptance Criteria

      Implementation Requirements

      • Ensure that BigInt values are always serialized to a BSON int64 value
      • Ensure that serialization follows the truncation behaviour laid out in the ECMAScript language spec

      Testing Requirements

      • Unit tests that directly inspect binary output of BSON.serialize when passed BigInt values and compares them to known cases
      • Implement tests from User-facing syntax section of the design document

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

              Created:
              Updated:
              Resolved: