问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/37961380/mongoexport-returning-scientific-exponential-notation