File size: 307 Bytes
28b14ff
b3e9a96
 
 
 
28b14ff
 
b3e9a96
 
 
 
 
 
28b14ff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from pymongo import MongoClient
import os
from dotenv import load_dotenv

load_dotenv()

# Connect to MongoDB

mongo_uri = os.getenv("MONGO_URI")
client = MongoClient(mongo_uri)  # replace with your URI
db = client[os.getenv("MONGO_DB_NAME")]  # replace with your database name

print("MongoDB Connected")