Hi storyteller and thanks for the answer.
I also indeed went through the PR code and test it a bit, and I manage to get it working.
It is basically as you say, the library relies on decimal.js so if you use a Decimal type when updating a mongo collection, thanks to the changes to EJSON it will be stored correctly in mongo 3.4+
The only difference is that I use typescript and to get the types working I had to do a little extra step:
there’s no types published for mongo-decimal, but decimal.js ships with typescript types in it.
Moreover decimal is also exposed globally to the app, not only through ES6 modules.
So the easier way for me to get going was to grab the decimal.global.d.ts file from the decimal.js repo, and put it in a place that typescript checks, and then I simply relied on the global Decimal type being there.
Anyway thanks again for the help!