File size: 369 Bytes
6eaadc5
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from motor.motor_asyncio import AsyncIOMotorClient
import os
from dotenv import load_dotenv

load_dotenv()

MONGO_URI = os.getenv("MONGODB_URI")
if not MONGO_URI:
    print("⚠️ WARNING: MONGODB_URI is not set in environment variables.")

# Create a global client instance
client = AsyncIOMotorClient(MONGO_URI)
db = client.lexguard_db  # Database name