Spaces:
Sleeping
Sleeping
# database/mongo_setup.py | |
from pymongo import MongoClient | |
def get_mongo_client(): | |
"""Connect to the MongoDB Atlas cluster.""" | |
connection_string = "mongodb+srv://shahid:Protondev%[email protected]/" | |
client = MongoClient(connection_string) | |
return client | |
def get_database(): | |
"""Connect to the task_management database.""" | |
client = get_mongo_client() | |
db = client["task_management"] | |
return db | |