I’m exploring using Decimal128 with Mongo and I saw that it is supported with the mongo-decimal package which is great. The package relies on decimal.js which is kind of large and will be shipped in the client bundle. I’d like to swap decimal.js for big.js. Does anyone know if this is possible?
I’ve tried a number of things including creating a local mongo-decimal package and forking big.js to use a Decimal constructor instead of Big (it looks like the mongo-driver specifically looks for an instanceof Decimal) but didn’t have success. When I started up I got an error like Decimal is not found in mongo-driver.js
@zebralucky I think you might have the most knowledge here . Appreciate any insights you might have and thanks for making the mongo-decimal package!
Update: I was able to get things working by creating a local mongo-decimal package. Not sure why it didn’t work on the first attempt. Maybe I missed exporting Decimal so that it was available to the mongo-driver.