Spaces:
Sleeping
Sleeping
File size: 400 Bytes
bae1a33 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | import asyncio
import os
from motor.motor_asyncio import AsyncIOMotorClient
async def check():
client = AsyncIOMotorClient(os.getenv("MONGODB_URL", "mongodb://localhost:27017"))
db = client.get_database(os.getenv("MONGODB_DB_NAME", "fitmate_db"))
c = await db["tcm_ingredients"].count_documents({})
print(f"Total documents: {c}")
if __name__ == "__main__":
asyncio.run(check())
|