CPS-API / db /mongo.py
Ali2206's picture
Update db/mongo.py
6dd577f verified
raw
history blame contribute delete
412 Bytes
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")