Spaces:
Sleeping
Sleeping
File size: 379 Bytes
7688281 |
1 2 3 4 5 6 7 8 9 10 11 12 |
from app import app, mongo
with app.app_context():
try:
db = mongo.db
# List collections to verify connection
collections = db.list_collection_names()
print("✅ MongoDB connected successfully!")
print("Existing collections:", collections)
except Exception as e:
print("❌ MongoDB connection failed:", str(e))
|