CPS-API / db /mongo.py
Ali2206's picture
Update db/mongo.py
88e4026 verified
raw
history blame
351 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"]