-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
In python 2.x PyMongo decodes BSON int64 to the python long type. Python 3 only has an int type so BSON int64 is decoded to int. This is a lossy conversion. There are several use cases for storing a low value integer as an int64 in MongoDB, but round tripping those value with python 3 loses information.
PyMongo's bson module should include a BSONInt64 class (I'm open to other names). It should inherit from long in python 2 and int in python 3. The bson codec will always encode it to BSON int64, regardless of value.
- is depended on by
-
PYTHON-708 Support new extended JSON types introduced in MongoDB 2.6
- Closed
- related to
-
PYTHON-923 Add 3.0 changelog entry about bson.int64.Int64
- Closed