Hi all,
I'm working with a MongoDb database that has JSON collections.
One of the fields of the documents in these collections are 64-bits integers stored as JSON numbers. They're application-specific fields, not something generated.
When I query the DB from Mongo CLI, I get integers alright. However, when I query through Monger, these integers are deserialized as java.lang.Double objects.
I know I always have the option of coercing to a long or BigInt after deserialization, but still, this does not seem right to me.
Is there any way to correct this behavior? Should it be considered a bug?
Example where this field is "userId":
From Mongo CLI
> db.mycoll.find();
{ "_id" : ObjectId("53452c104900004b00d88287"),
"userId" : 100001465868054 }
[...]
From Clojure console using Monger :
> (monger.collection/find-one "mycoll")
{"_id" #<ObjectId 53452c104900004b00d88287>, "userId" 1.00001465868054E14}
>(.get *1 "userId")
1.00001465868054E14
> (class *1)
java.lang.Double
Thanks in advance,
Valentin Waeselynck.