forked from mongodb/node-mongodb-native
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Long bugs, and represent Longs as Numbers when possible.
Before, any JS Number which was an integer would be serialized as an INT if it fit in 32 bits, and as a LONG otherwise. This broke when integral Numbers were larger than 2^63. Now such numbers are represented as DOUBLEs. Before, any Long was deserialized as a Long, which was awkward because you'd serialize a Number and get back a Long, which is awkward to deal with. Now, any Long which is in [-2^53, 2^53] (a range that can be precisely represented by a JS Number) is deserialized as a Number.
- Loading branch information
Showing
2 changed files
with
75 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters