Download scripts/check_mongo.py from DiabetesCareChatbot/dmChatbotBackend: direct link, hf CLI and curl.
- Browser
- Download file 401 Bytes
-
https://huggingface.co/spaces/DiabetesCareChatbot/dmChatbotBackend/resolve/main/scripts/check_mongo.py
- Command line
-
hf download hf://spaces/DiabetesCareChatbot/dmChatbotBackend/scripts/check_mongo.py
-
curl -L -o check_mongo.py https://huggingface.co/spaces/DiabetesCareChatbot/dmChatbotBackend/resolve/main/scripts/check_mongo.py
401 Bytes
| from pymongo import MongoClient | |
| import os | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| mongo_uri = os.getenv("MONGO_URI", "mongodb://localhost:27017/") | |
| client = MongoClient(mongo_uri) | |
| print("Databases found:") | |
| for db in client.list_database_names(): | |
| print(f"- {db}") | |
| for coll in client[db].list_collection_names(): | |
| print(f" -- {coll} ({client[db][coll].count_documents({})} docs)") | |