0

I am trying to insert a document having a geocoordinate key with value [77.218624, 28.635101] but when I insert in mongodb from the shell I get this value in the database [ 77.21862400000001, 28.635101 ], Can anybody tell why this number is being changed after inserting into mongoDb

Shalu
  • 251
  • 2
  • 4
  • 15
  • Because it isn't exactly representable. There are lots of answers about floating point here. eg http://stackoverflow.com/questions/17612654/why-float-taking-0-699999-instead-of-0-7 – doctorlove Jul 17 '14 at 09:22
  • But for a geocoordinate if the values changes it meaning and location will change with a very high difference. – Shalu Jul 17 '14 at 09:25

0 Answers0