Spaces:
Runtime error
Runtime error
Create db.py
Browse files
db.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pymongo import MongoClient
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
MONGO_URI = "mongodb+srv://be1newinner:0r9v0ercEMINIJfK@cluster0.y2mqe.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0"
|
| 5 |
+
client = MongoClient(MONGO_URI)
|
| 6 |
+
db = client["chatbot_db"]
|
| 7 |
+
users_collection = db["users"]
|
| 8 |
+
sessions_collection = db["sessions"]
|
| 9 |
+
chat_history_collection = db["chat_history"]
|
| 10 |
+
activity_log_collection = db["activity_log"]
|