Documentation Index
Fetch the complete documentation index at: https://docs.ub.bitbros.in/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/data/:collectionName/aggregate
Runs a MongoDB aggregation pipeline on the specified collection. This allows for complex data processing, grouping, and transformations.
Required header
x-api-key: your pk_live_… or sk_live_… key.
Path parameters
The name of the collection to aggregate.
Query parameters
If
true, includes soft-deleted documents (where isDeleted: true) in the aggregation. Defaults to false.Request body
An array of aggregation stages following the standard MongoDB aggregation pipeline syntax.
For security reasons, certain stages like
$out and $merge are blocked.RLS behavior
If Row-Level Security (RLS) is enabled, your backend automatically injects a$match stage at the beginning of your pipeline (or after $geoNear / $search if present). This ensures users only aggregate data they have access to.
Response fields
true when the aggregation was executed successfully.The results of the aggregation pipeline.
Human-readable status message.
Code examples
Success response
Errors
| Status | Cause |
|---|---|
400 Bad Request | Invalid pipeline syntax or blocked stage used |
401 Unauthorized | Missing or invalid API key |
404 Not Found | Collection does not exist |
