xbackend/crud/base.py
2021-05-01 12:57:46 +08:00

10 lines
208 B
Python

from bson import ObjectId
class CRUDBase:
def __init__(self, coll_name):
self.coll_name = coll_name
async def get(self, coll, id: ObjectId):
return await coll.find_one({'_id': id})