Example #1
0
async def get_single_person(_id: str,
                            db: AsyncIOMotorClient = Depends(get_database)):
    return modify_id_response(await mongo.person.find_one(db, _id))
Example #2
0
File: tag.py Project: jongsoobae/IQ
async def find(db):
    rows = model(db).find().sort("_id", -1)
    return [modify_id_response(row) async for row in rows]
Example #3
0
async def insert_one(db, question: Question):
    created = await model(db).insert_one(question.dict())
    return modify_id_response(await
                              model(db).find_one({"_id": created.inserted_id}))