Dears,
Record in mongo shell(3.2.6):
> db.users.find({_id:ObjectId('576b8ba158e039761d94dcf6')}).pretty()
{
"_id" : ObjectId("576b8ba158e039761d94dcf6"),
"name" : "test",
"roles" : [1,9],
"point" : 0,
"createTime" : ISODate("2016-06-23T15:08:04.130Z")
}
However, if retrieving this record using pymongo(3.2.2), the "roles" field above, which is array of int, are changed into array of float:
>>> from pymongo import MongoClient
>>> from bson.objectid import ObjectId
>>> client = MongoClient()
>>> doc = db.users.find_one({'_id':ObjectId('576b8ba158e039761d94dcf6')})
>>> print doc
{u'_id': ObjectId('576b8ba158e039761d94dcf6'), u'name': u'test', u'roles': [1.0, 9.0], u'point': 0, u'createTime': datetime.datetime(2016, 6, 23, 15, 8, 4, 130000)}
Is this behavior is expected?
Thanks and Regards,
Samuel Feng