Smart-Tasker / database /setup_db.py
Shahid
Added first commit
af30a30
raw
history blame contribute delete
437 Bytes
# 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