Views

All usage topics

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.

Creating a View

  1. Navigate to Data → Views and click New View.
  2. Source tab - enter a title, choose the primary source collection, and select the MongoDB connection.
  3. Pipeline tab - add aggregation stages in order. Each stage has a type and a JSON config object.
  4. Display tab - choose table or list mode, set page size, and optionally define column definitions.
  5. Access tab - select which roles can access this view and whether it is publicly accessible.
  6. Click Save View, then use Preview to execute and inspect the results.

Allowed Pipeline Stage Types

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.

Column Definitions

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.

Public Access

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.