Closed elie222 closed 3 years ago
What exactly are the errors you're seeing?
This library does support Decimal128, but it just types it as number
since Typescript doesn't have more accurate types, so if using number
worked in the past then it should work with the library (if I'm understanding correctly). If you can provide a brief example that'd be super useful!
Decided to move away from Decimal128 in the end to get around this issue.
Pretty sure Decimal128 wasn't being typed as number but was using the Mongo Decimal128 object which is different. So we were doing something like this to convert between the two:
Even though it was only a TS thing and number would have been fine in these cases (as it was before we were using types here).
Best, Eliezer
On Thu, Sep 23, 2021 at 1:15 AM, Francesco Virga < @.*** > wrote:
What exactly are the errors you're seeing?
This library does support Decimal128, but it just types it as number since Typescript doesn't have more accurate types, so if using number worked in the past then it should work with the library (if I'm understanding correctly). If you can provide a brief example that'd be super useful!
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub ( https://github.com/francescov1/mongoose-tsgen/issues/67#issuecomment-925368590 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AAXSQX6R7ZSNKOUCTHQ4BRDUDJIPJANCNFSM5ESKH7RA ).
Ahh yes the Mongoose version of the doc gets typed as the Mongoose Decimal128 type, whereas the non-mongoose version uses number. Havent had many users need decimal128 so haven't seen much on how people use it. If you ever run into more issues with it let me know and I'd be happy to go deeper into the setup!
We just added this library and we use
Decimal128
quite a lot. Till now these fields were fine acceptingnumber
but with this package added it's causing a problem asnumber
isn't the same asDecimal128
.Any recommendations on how to handle this issue?