save to db as integer, but read out got float number
98 views
Skip to first unread message
Henry John
unread,
Jun 1, 2015, 6:48:34 AM6/1/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongod...@googlegroups.com
Hi, all
My MongoDB version is 2.4.9
Here is an record:
{
"ClientID" : 3308442,
"sid" : 231
}
all data are integers.
but when I use pymongo (Python mongo sdk) to find this document and read its items, print out as :
sid:213.0
ClientID:3258107.0
Why the integer fields are converted into float numbers?
Regards!
Stephen Dillon
unread,
Jun 2, 2015, 7:48:41 AM6/2/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongod...@googlegroups.com
Try reading the data via the Mongo shell and see what you get. Could
some change to the Python Mongo sdk, which I am completely unfamiliar with, be manifesting this as a display issue?
I had a similar thing happen using RoboMongo 8.5 and MongoDB 2.6.4. What we discovered in our scenario was that the display of the data in Robomongo was incorrect but the actual underlying value in JSON was correct.