protocol_manager.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 protocol_manager.db.mongodb.Database#

MongoDB database handle.

client: motor.motor_asyncio.AsyncIOMotorClient | motor.motor_asyncio.AsyncIOMotorDatabase | None = None#
collection: motor.motor_asyncio.AsyncIOMotorCollection | None = None#
protocol_manager.db.mongodb.db#
async protocol_manager.db.mongodb.connect_to_mongo()#

Connect to MongoDB using the configuration settings.

async protocol_manager.db.mongodb.close_mongo_connection()#

Close the connection to MongoDB.

protocol_manager.db.mongodb.get_mongo_database() → Database#

Dependency for getting a handle to the MongoDB database.