Spaces:
Sleeping
Sleeping
| import certifi | |
| from motor.motor_asyncio import AsyncIOMotorClient | |
| from core.config import MONGO_URI | |
| # Create MongoDB client with TLS certificate | |
| client = AsyncIOMotorClient(MONGO_URI, tls=True, tlsCAFile=certifi.where()) | |
| # Access main database | |
| db = client["cps_db"] | |
| # Collections | |
| users_collection = db["users"] | |
| patients_collection = db["patients"] | |
| appointments_collection = db.get_collection("appointments") | |