v5
latestOpenAPI 3.1.02026-08-025631,1012.8 MBBucket Objects
Aggregate Objects
This endpoint performs aggregation operations on objects in a bucket.
**Aggregation Framework**: Provides MongoDB-style aggregation operations:
- GROUP BY: Group objects by one or more fields
- Aggregations: COUNT, SUM, AVG, MIN, MAX, COUNT_DISTINCT, etc.
- Date Operations: Truncate or extract date parts for time-series analysis
- Filtering: Pre-aggregation filters (WHERE) and post-aggregation filters (HAVING)
- Sorting & Limiting: Control result ordering and size
**Use Cases**:
- Count objects by status or category
- Calculate daily/monthly upload statistics
- Analyze content distribution and trends
- Generate reports with multiple metrics
**Note**: This endpoint works with both MongoDB objects and Qdrant documents
using the same interface. The system automatically selects the appropriate
aggregation provider.
post/v1/buckets/{bucket_identifier}/objects/aggregate
Path parameters
bucket_identifierstring required
The unique identifier of the bucket.
The unique identifier of the bucket.
Request body
Example request
{
"aggregations": [
{
"alias": "total",
"function": "count"
}
],
"description": "Count objects by status",
"group_by": [
{
"alias": "status",
"field": "status"
}
],
"sort_by": "total",
"sort_direction": "desc"
}Response
Successful Response
Example response
{
"query_info": {
"execution_time_ms": 45,
"pipeline_stages": 5
},
"results": [
{
"group": {
"status": "completed"
},
"metrics": {
"total": 1523
}
},
{
"group": {
"status": "pending"
},
"metrics": {
"total": 87
}
}
],
"total_groups": 2
}