我是MongoDB的新手。我已经在一个集合中插入了一个浮点数。但是,当我通过mongoexport导出该集合时,浮点数会改变。
这是数据库中的内容:
{" _id" :ObjectId(" 56653e23a6b56616ba417bcd")," id" :" 601318"," name" :"中国平安","买" :[{" time" :ISODate(" 2015-06-15T01:30:00Z"),"价格" :86.9,"数量" :1000,"价值" :87074.4},"出售" :[{" time" :ISODate(" 2015-07-07T01:30:00Z"),"价格" :80.88,"数量" :1000,"价值" :80636.76}]}
这是它被导出到json的时候:
{" _id" :{" $ oid" :" 56653e23a6b56616ba417bcd" }," id" :" 601318"," name" :"中国平安","买" :[{" time" :{" $ date" :" 2015-06-15T09:30:00.000 + 0800" },"价格" :86.90000000000001,"数量" :1000,"价值" :87074.39999999999}],"出售" :[{" time" :{" $ date" :" 2015-07-07T09:30:00.000 + 0800" },"价格" :80.88,"数量" :1000,"价值" :80636.75999999999}]}
如何避免这种溢出?