File size: 433 Bytes
50aeac3
7e0e71d
50aeac3
1b22be4
7e0e71d
1b22be4
 
7e0e71d
1b22be4
 
7e0e71d
50aeac3
1b22be4
50aeac3
7e0e71d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os
from motor.motor_asyncio import AsyncIOMotorClient

# Get the MongoDB URI from Hugging Face secrets
MONGO_URI = os.environ.get("MONGODB_URI")

# Initialize the async MongoDB client
client = AsyncIOMotorClient(MONGO_URI)

# Automatically get the default database (from the URI)
db = client.get_default_database()

# Expose collections
patients_collection = db["patients"]
results_collection = db["patient_analysis_results"]