exam-manager.app.db.mongodb#

MongoDB database handle.

Attributes#

db

Classes#

Database

MongoDB database handle.

Functions#

connect_to_mongo()

Connect to MongoDB using the configuration settings.

close_mongo_connection()

Close the connection to MongoDB.

get_mongo_database(→ Database)

Dependency for getting a handle to the MongoDB database.

Module Contents#

class exam-manager.app.db.mongodb.Database#

MongoDB database handle.

Attributes#

clientAsyncIOMotorClient

The MongoDB client.

collectionAsyncIOMotorCollection

The MongoDB collection.

client: motor.motor_asyncio.AsyncIOMotorClient | motor.motor_asyncio.AsyncIOMotorDatabase | None = None#
collection: motor.motor_asyncio.AsyncIOMotorCollection | None = None#
exam-manager.app.db.mongodb.db#
async exam-manager.app.db.mongodb.connect_to_mongo()#

Connect to MongoDB using the configuration settings.

async exam-manager.app.db.mongodb.close_mongo_connection()#

Close the connection to MongoDB.

exam-manager.app.db.mongodb.get_mongo_database() Database#

Dependency for getting a handle to the MongoDB database.