Skip to content

Optimistic and efficient CRUD wrapper for MongoDB with built-in Pydantic validation and safe error handling

License

Notifications You must be signed in to change notification settings

mukund-thorat/MongoGuard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Medusa Logo

MongoGuard

A lightweight, optimistic, and efficient CRUD layer for MongoDB — built with safety, validation, built-in logging, and error handling, all designed for simplicity and reliability.


📌 Features

  • ✅ Automatic error handling
  • 🧩 Integrated logging for all operations
  • 🔒 Full Pydantic model support
  • 🔁 Type-safe input and output using Pydantic BaseModels

📦 Installation

pip install mongoguard

Example

from mongoguard import MongoGuard
from pydantic import BaseModel

mg = MongoGuard(
    mongo_url="mongodb://localhost:27017/",
    db_name="Example",
    collection_name="User"
)

class UserModel(BaseModel):
    id: int
    name: str
    email: str
    password: str

mg.fetch_collection(out_model=UserModel)

❤️ Contributing & Community

Created and maintained by Mukund Thorat.
We welcome contributors to help improve MongoGuard! If you are interested in contributing or collaborating, please contact me via email: mukundthorat.official@gmail.com

🔐 License

This project is licensed under the terms of the MIT license.

About

Optimistic and efficient CRUD wrapper for MongoDB with built-in Pydantic validation and safe error handling

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages