Skip to content

# 🧩 mongo-ops — Async MongoDB Operations Layer for FastAPI

`mongo-ops` is a modular, high-performance MongoDB operations library designed for FastAPI microservices. It standardizes repository patterns, async CRUD operations, and model management — with extensible components for both Beanie and Motor.

## 🚀 Key Features

- 🧱 Unified repository pattern for MongoDB collections
- ⚡ Fully asynchronous (Motor-based)
- 🧬 Pydantic v2 data model integration
- 🧰 Built-in CRUD and aggregation utilities
- 🔒 Transaction and session helpers
- 🧩 Optional Beanie ORM integration
- 🧪 Pytest-friendly architecture

## 📦 Installation

From your internal PyPI:

Bash

    pip install --extra-index-url https://$PYPI_USERNAME:$PYPI_PASSWORD@pip.aetoskia.com/simple mongo-ops

From local source:

Bash

    pip install -e .

## 📁 Documentation Structure

Section | Description
--- | ---
Overview | Core concept and architecture overview
Core Components | `BaseDocument`, `MongoConnectionManager`, `BaseRepository`
Use Cases | CRUD, transactions, pagination, and more
Best Practices | Recommended repo structure and patterns
Common Patterns | Service layer, aggregation, soft deletes
Error Handling | Centralized error and exception management
Testing | Pytest configuration and fixtures

## 🔗 Related Resources

- Source Code: Gitea Repository
- Internal PyPI: pip.aetoskia.com/simple/mongo-ops
- Drone CI: Auto-builds and publishes tagged releases.

© Aetoskia Internal — `mongo-ops` 0.1.2