File size: 402 Bytes
cd3078d
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from app.database import connect_db, close_db, get_db
import asyncio

async def check_users():
    await connect_db()
    db = get_db()
    users = await db.users.find({}).to_list(length=100)
    print(f"Found {len(users)} users:")
    for user in users:
        print(f"- {user.get('email')} (Role: {user.get('role')})")
    await close_db()

if __name__ == "__main__":
    asyncio.run(check_users())