Domma CMS User Manual

Views

Updated by Darryl Waterhouse on 29 September 2026 2 min read

Views are admin-designed display configurations that query one or more Collections via a stored aggregation-style pipeline, then render the results in the admin panel or on a page with [view]. They work on every storage adapter: MongoDB-backed collections run native aggregations, and file-backed collections run the built-in pipeline evaluator. No MongoDB connection is required.

Creating a View

  1. Navigate to Data → Views and click New View.
  2. Source tab - enter a title, choose the primary source collection and, if the collection lives on MongoDB, the connection to use.
  3. Pipeline tab - add aggregation stages in order. Each stage has a type and a JSON config object.
  4. Display tab - choose table, list or block mode, set the page size (1 to 200) and pick the table's columns.
  5. Access tab - choose which roles can read the view's results, whether it is public, and an optional row-level rule.
  6. Save the view. The Results tab runs the pipeline as it stands, saved or not, and shows the first rows.

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.

Columns

On the Display tab, pick which fields the table shows, in order, and what each heading says. The field lists come from the source collection. With none chosen, the first six fields of the first result are shown.

Who can read a view

The Access tab decides who sees the view's results, both on pages ([view]) and at GET /api/views/:slug/public:

  • Public - anyone, signed in or not.
  • Roles - signed-in users holding any listed role, and everyone more senior (the same ladder as page visibility; =role means that role only). A role the site no longer has admits only the level-0 role.
  • No roles and not public - the admin tier only (role levels 0 and 1).

A visitor who may not read the view gets its empty message on the page, never the rows.

Row-level rules

A row-level rule shows each user only the results that are theirs: Owner (entries they created) or Field match (entries whose chosen field equals their id, email, name or role). Totals and page counts count only the rows that user may see, and the level-0 role sees everything. A page showing such a view is rendered fresh for each signed-in visitor rather than served from the shared cache.

Showing a view on a page

[view slug="open-jobs" display="cards" columns="3" title-field="title" /]
[view slug="open-jobs" searchable sortable page-size="20" /]

The shortcode can use any display (table, cards, list, accordion, timeline, carousel, listgroup, block); left out, it uses the view's own. Adding searchable, sortable or paginate makes it interactive. See Shortcodes.