Spaces:
Runtime error
Runtime error
Download config/database.py from Soham0708/forensicLogsChaiAi: direct link, hf CLI and curl.
- Browser
- Download file 376 Bytes
-
https://huggingface.co/spaces/Soham0708/forensicLogsChaiAi/resolve/main/config/database.py
- Command line
-
hf download hf://spaces/Soham0708/forensicLogsChaiAi/config/database.py
-
curl -L -o database.py https://huggingface.co/spaces/Soham0708/forensicLogsChaiAi/resolve/main/config/database.py
376 Bytes
| import pymongo | |
| import gridfs | |
| # database connection | |
| client = pymongo.MongoClient( | |
| "mongodb+srv://soham2000:soham2000@cluster0.lbu4i.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0", | |
| ssl=True, | |
| ) | |
| db = client["nodetest"] | |
| user_collection = db["users"] | |
| chat_collection = db["chats"] | |
| log_collection = db["logs"] | |
| fs = gridfs.GridFS(db) # Initialize GridFS bucket | |