Swift-Query / tests /create_chat_session_collection.py
Darshan Kumar R
Deploy to Hugging Face Spaces (Clean)
ed0b977
Raw History Blame Contribute Delete
500 Bytes
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../')))
from main import app
from utils.db.db import mongo
def create_chat_session_collection():
with app.app_context():
try:
mongo.db.create_collection("chatsession")
print("Collection 'chatsession' created successfully.")
except Exception as e:
print(f"An error occurred: {e}")
if __name__ == "__main__":
create_chat_session_collection()