So I was exporting some collections using mongoexport
and found cases where large integers such as 9999999999999
were exported as 9.9999999999999e+13
So two questions: Why is this the case, and how can I prevent this?
Thank you.
MongoDB treats all number literals as floating point by default, and above a certain threshold (32 bits?) it switches to scientific notation when exporting to JSON.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With