File size: 437 Bytes
af30a30
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 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