Hi,
i'm facing a problem while trying to store geolocalised points and key / values attached to it. The problem i'm encountering is that i need to check if a given point (identified by a couple lat / long) is already existing in the database or not.
Depending on the way i'm inserting my geolocalised points (either from pymongo, javascript shell or mongoimport), i get different results.
For instance, i try to store value 0.7 as a float using each of the 3 ways.
The results i get are the following :
{ "_id" : ObjectId("4da6e294aea05d721a4a87b9"), "value_from_mongoimport" : 0.7000000000000001 } { "_id" : ObjectId("4da6e2a3e36333098e18d40c"), "value_from shell" : 0.7 } { "_id" : ObjectId("4da6e2aa11f4ac1bc0000000"), "value_from_pymongo" : 0.7 }I'm precisely using the "mongoimport way" to store data as it offers better performances than other ways.
The problem is, at a later time, when i do, from python, somethink like :
db.testfind_one(
), i get none ......
I understand the problem of floating point representation, but why is it only affecting mongoimport ? is this something that implies the json to bson transformation ?
Help appreciated.
Regards.