🚀 Getting Started with Monggregate
📋 Overview
Monggregate is a Python library designed to simplify working with MongoDB aggregation pipelines. It provides an object-oriented interface that lets you focus on data transformation requirements rather than MongoDB syntax.
📥 Installation
Monggregate is available on PyPI:
✅ Requirements
- Python 3.10 or higher
- Dependencies:
pydantic
,pyhumps
, andtyping-extensions
- A MongoDB driver for executing the query builder (e.g.,
pymongo
)
📚 For a complete list of requirements, see the requirements files in the repository.
🧩 Basic Concepts
Monggregate's primary components:
- 📚 Pipeline: The main class used to build and chain MongoDB aggregation operations
- 🔄 Stages: Individual operations like
match
,group
,sort
, etc. - 🛠️ Operators: MongoDB operators implemented with intuitive Python syntax
⚡ Quick Start Example
Here's a simple example to get you started:
🔧 Using the Pipeline Builder
💡 The recommended way to use Monggregate is through the
Pipeline
class.
When you type pipeline.
in your IDE, you'll see all available aggregation stages through autocompletion:
🌟 Advanced Usage
Monggregate supports advanced MongoDB features like expressions and operators:
🔜 Next Steps
- 📚 Learn more about building pipelines
- 🔄 Explore available aggregation stages
- 🛠️ Discover how to use MongoDB operators
- 🔍 Try vector search capabilities