-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
https://github.com/mongodb/js-bson/issues/363
when use BigInt value, I can simply add toBSON method this BigInt.prototype
BigInt.prototype.toBSON = function() { return this.toString() }
But when pass the 0n value, bson serializer is not working on this line:
//Line 689 in serializer.js // you should test value as a nil value but not a `0n` value. if (value && value.toBSON) { if (typeof value.toBSON !== 'function') throw new TypeError('toBSON is not a function'); value = value.toBSON(); }
Or you could just add BigInt value support.