- mongo-ops now serves /mongo-ops/wiki/ and /mongo-ops/lib/ independently - add mongo-ops MCP bundle under mcp/mongo-ops - fix copy-paste mcp server (jwtlib -> mongo_ops) in config.yml - .drone.yml/Dockerfile: publish port 8007 for mongo-ops MCP
81 lines
4.6 KiB
JSON
81 lines
4.6 KiB
JSON
{
|
|
"module": "mongo_ops.connection",
|
|
"content": {
|
|
"path": "mongo_ops.connection",
|
|
"docstring": "MongoDB connection management.",
|
|
"objects": {
|
|
"asynccontextmanager": {
|
|
"name": "asynccontextmanager",
|
|
"kind": "alias",
|
|
"path": "mongo_ops.connection.asynccontextmanager",
|
|
"signature": "<bound method Alias.signature of Alias('asynccontextmanager', 'contextlib.asynccontextmanager')>",
|
|
"docstring": null
|
|
},
|
|
"Optional": {
|
|
"name": "Optional",
|
|
"kind": "alias",
|
|
"path": "mongo_ops.connection.Optional",
|
|
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
|
"docstring": null
|
|
},
|
|
"AsyncIOMotorClient": {
|
|
"name": "AsyncIOMotorClient",
|
|
"kind": "alias",
|
|
"path": "mongo_ops.connection.AsyncIOMotorClient",
|
|
"signature": "<bound method Alias.signature of Alias('AsyncIOMotorClient', 'motor.motor_asyncio.AsyncIOMotorClient')>",
|
|
"docstring": null
|
|
},
|
|
"AsyncIOMotorDatabase": {
|
|
"name": "AsyncIOMotorDatabase",
|
|
"kind": "alias",
|
|
"path": "mongo_ops.connection.AsyncIOMotorDatabase",
|
|
"signature": "<bound method Alias.signature of Alias('AsyncIOMotorDatabase', 'motor.motor_asyncio.AsyncIOMotorDatabase')>",
|
|
"docstring": null
|
|
},
|
|
"MongoConnectionManager": {
|
|
"name": "MongoConnectionManager",
|
|
"kind": "class",
|
|
"path": "mongo_ops.connection.MongoConnectionManager",
|
|
"signature": "<bound method Class.signature of Class('MongoConnectionManager', 8, 114)>",
|
|
"docstring": "Manages MongoDB connections with async lifecycle.\n\nThis class provides a singleton-like manager for the MongoDB client and \ndatabase instances, ensuring they are properly initialized and closed \nacross the application lifecycle.",
|
|
"members": {
|
|
"connect": {
|
|
"name": "connect",
|
|
"kind": "function",
|
|
"path": "mongo_ops.connection.MongoConnectionManager.connect",
|
|
"signature": "<bound method Function.signature of Function('connect', 22, 45)>",
|
|
"docstring": "Connect to MongoDB and initialize the shared client.\n\nArgs:\n uri: MongoDB connection URI (e.g., \"mongodb://localhost:27017\").\n db_name: Name of the database to use.\n **kwargs: Additional Motor client options (e.g., maxPoolSize).\n\nReturns:\n AsyncIOMotorDatabase: The initialized database instance."
|
|
},
|
|
"disconnect": {
|
|
"name": "disconnect",
|
|
"kind": "function",
|
|
"path": "mongo_ops.connection.MongoConnectionManager.disconnect",
|
|
"signature": "<bound method Function.signature of Function('disconnect', 47, 55)>",
|
|
"docstring": "Close the active MongoDB connection and cleanup resources."
|
|
},
|
|
"get_database": {
|
|
"name": "get_database",
|
|
"kind": "function",
|
|
"path": "mongo_ops.connection.MongoConnectionManager.get_database",
|
|
"signature": "<bound method Function.signature of Function('get_database', 57, 70)>",
|
|
"docstring": "Retrieve the current database instance.\n\nReturns:\n AsyncIOMotorDatabase: The active database instance.\n\nRaises:\n RuntimeError: If connect() has not been called yet."
|
|
},
|
|
"get_client": {
|
|
"name": "get_client",
|
|
"kind": "function",
|
|
"path": "mongo_ops.connection.MongoConnectionManager.get_client",
|
|
"signature": "<bound method Function.signature of Function('get_client', 72, 85)>",
|
|
"docstring": "Retrieve the current client instance.\n\nReturns:\n AsyncIOMotorClient: The active Motor client instance.\n\nRaises:\n RuntimeError: If connect() has not been called yet."
|
|
},
|
|
"lifespan": {
|
|
"name": "lifespan",
|
|
"kind": "function",
|
|
"path": "mongo_ops.connection.MongoConnectionManager.lifespan",
|
|
"signature": "<bound method Function.signature of Function('lifespan', 87, 114)>",
|
|
"docstring": "Async context manager for managing connection lifecycle.\n\nDesigned for use with FastAPI or other frameworks supporting \nlifespan management.\n\nArgs:\n uri: MongoDB connection URI.\n db_name: Name of the database.\n **kwargs: Additional Motor client options.\n\nYields:\n AsyncIOMotorDatabase: The active database instance.\n\nUsage:\n @asynccontextmanager\n async def lifespan(app: FastAPI):\n async with MongoConnectionManager.lifespan(uri, db_name):\n yield"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |