Spaces:
Sleeping
Sleeping
Update db/mongo.py
Browse files- db/mongo.py +7 -1
db/mongo.py
CHANGED
|
@@ -2,6 +2,12 @@ import certifi
|
|
| 2 |
from motor.motor_asyncio import AsyncIOMotorClient
|
| 3 |
from core.config import MONGO_URI
|
| 4 |
|
|
|
|
| 5 |
client = AsyncIOMotorClient(MONGO_URI, tls=True, tlsCAFile=certifi.where())
|
|
|
|
|
|
|
| 6 |
db = client["cps_db"]
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
from motor.motor_asyncio import AsyncIOMotorClient
|
| 3 |
from core.config import MONGO_URI
|
| 4 |
|
| 5 |
+
# Create MongoDB client with TLS certificate
|
| 6 |
client = AsyncIOMotorClient(MONGO_URI, tls=True, tlsCAFile=certifi.where())
|
| 7 |
+
|
| 8 |
+
# Access main database
|
| 9 |
db = client["cps_db"]
|
| 10 |
+
|
| 11 |
+
# Collections
|
| 12 |
+
users_collection = db["users"]
|
| 13 |
+
patients_collection = db["patients"]
|