ObjectID简介
mongo存储的数据在没有特别指定_id数据类型时,默认类型为ObjectID
‘_id’: ObjectId(‘55717c9eb2c983c127000000’)
ObjectId is a 12-byte BSON type, constructed using:
- a 4-byte value representing the seconds since the Unix epoch,
- a 3-byte machine identifier,
- a 2-byte process id, and
- a 3-byte counter, starting with a random value.
python处理方式
基本思路就是转换成时间对象 ,然后处理.
objectid – Tools for working with MongoDB ObjectIds
Tools for working with MongoDB ObjectIds.
class bson.