-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
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
- is related to
-
NODE-4887 serializeInto does not check for the presence of a toBSON method for values in Map entries
- Closed