mongoexport返回科学(指数)表示法 [英] mongoexport returning scientific (exponential) notation

查看:91
本文介绍了mongoexport返回科学(指数)表示法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我使用mongoexport导出了一些集合,并发现了将9999999999999之类的大整数导出为9.9999999999999e+13

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?

谢谢.

推荐答案

MongoDB将所有数字文字视为

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.

这篇关于mongoexport返回科学(指数)表示法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆