📄️ Introduction
MongoDB has a powerful Aggregation framework that allows you to perform complex queries on your data. This package provides a simple way to build and execute these queries.
📄️ Aggregate Class
We had a quick overview over the MongoDB Aggregate Framework, now let's see how we can use it in our application.
📄️ Selecting Columns / Projecting
To select/deselect fields, you can use one of three methods: select, deselect and project.
📄️ Filtering
Perform filtering on your data using the where methods.
📄️ $agg
The $agg utility is a helper that helps you build your aggregate query in a more readable way.
📄️ Skip
Skip documents in the collection.
📄️ Limit
Limit the number of documents returned from the collection.
📄️ Unwind
Unpack an array field from the input documents to output a document for each element.
📄️ Group By
This stage represents the $group stage in MongoDB.
📄️ Lookup (Joins)
Perform lookups (joins) on your collections.
📄️ Advanced Usage
Aggregate class is also shipped with more useful methods to help you use queries easily.
📄️ Delete Documents
Delete Documents using Aggregate class.
📄️ Fetching Documents
Fetching documents using Mongez Aggregate class.
📄️ Sorting
Sorting is the process of arranging documents in a collection in a specific order, The Aggregate class provides multiple methods to easily sort your documents.
📄️ Data Update
Update documents using Aggregate class.
📄️ Model Aggregate
Combine Models with Aggregate Class.