Currently, jobs are referred to by a generated uuid. The same role can be fulfilled by an object id adding the benefits of database indexing. A b64id property can be added to the MongoDocument that will return a base64 encoded object id.
Additionally, MongoDocument#find_one can be extended to accept an id parameter and, based on it's length, will perform a search by id. i.e.
def find_one(database, **query):
if 'id' in query:
id = query.pop('id')
# 16 chars indicate b64 encoded 12 bytes
id = b64decode(id) if len(id) == 16 else id
query['_id'] = ObjectId(id)
...
Currently, jobs are referred to by a generated uuid. The same role can be fulfilled by an object id adding the benefits of database indexing. A
b64id
property can be added to theMongoDocument
that will return a base64 encoded object id.Additionally,
MongoDocument#find_one
can be extended to accept an id parameter and, based on it's length, will perform a search by id. i.e.