Views
Usage
Views are admin-designed display configurations that query one or more Collections via a stored MongoDB aggregation pipeline, then render the results in the admin panel. Views require a MongoDB connection configured under Collections → Options.
- Navigate to Data → Views and click New View.
- Source tab — enter a title, choose the primary source collection, and select the MongoDB connection.
- Pipeline tab — add aggregation stages in order. Each stage has a type and a JSON config object.
- Display tab — choose table or list mode, set page size, and optionally define column definitions.
- Access tab — select which roles can access this view and whether it is publicly accessible.
- Click Save View, then use Preview to execute and inspect the results.
| Stage | Purpose |
|---|---|
$match |
Filter documents by condition |
$lookup |
Left join from another collection |
$sort |
Sort documents |
$project |
Include or exclude fields |
$unwind |
Deconstruct an array field |
$addFields |
Compute and add new fields |
$group |
Group and aggregate |
$count |
Count documents |
$skip |
Skip documents (added automatically for pagination) |
$limit |
Limit documents (added automatically for pagination) |
Forbidden stages ($out, $merge, $function, $accumulator,
$graphLookup) are rejected at save and execution time.
On the Display tab, column definitions are a JSON array. Each object has a key
(dot-path into the result document) and a label.
[
{ "key": "data.name", "label": "Name" },
{ "key": "data.email", "label": "Email" },
{ "key": "orders", "label": "Orders" }
]
If no columns are defined, the preview auto-generates columns from the first result document.
Tick Public on the Access tab to expose the view via
GET /api/views/:slug/public without requiring a login.
Leave it unticked to require JWT authentication with one of the allowed roles.