Controllers added updated implementations and tests awaits

This commit is contained in:
2025-03-31 23:51:27 +03:00
parent 2d32842782
commit 5d30bc2701
20 changed files with 2188 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
# Initialize the MongoDB handler with your configuration
from Controllers.Mongo.database import mongo_handler
# Use the collection with automatic retry capabilities
with mongo_handler.collection("users") as users_collection:
# These operations will automatically retry on failure
users_collection.insert_one({"username": "john", "email": "john@example.com"})
# Find operations also have retry capabilities
user = users_collection.find_one({"username": "john"})
# Update operations will retry if they encounter transient errors
users_collection.update_one(
{"username": "john"}, {"$set": {"last_login": "2025-03-31"}}
)