A View is a saved MongoDB aggregation pipeline that runs against a collection and returns shaped results. Views are created under Data → Views and exposed via a REST endpoint that respects role-level and row-level access.
Views require a MongoDB connection configured in config/connections.json.
| Stage | Purpose |
|---|---|
$match | Filter documents by field values |
$sort | Order results |
$project | Include, exclude, or rename fields |
$lookup | Join from another collection |
$unwind | Flatten an array field |
$addFields | Compute new fields |
$group | Aggregate (count, sum, etc.) |
$limit | Cap results |
$skip | Skip N results |
$count | Return a document count |
Blocked: $out, $merge, $function, $accumulator, $graphLookup
Collections are prefixed cms_ in MongoDB — use this prefix in $lookup from values.
Match active entries and count related submissions:
[
{ "$match": { "data.isActive": true } },
{
"$lookup": {
"from": "cms_feedback",
"localField": "_id",
"foreignField": "data.userId",
"as": "submissions"
}
},
{ "$addFields": { "submissionCount": { "$size": "$submissions" } } },
{ "$project": { "data.name": 1, "data.email": 1, "submissionCount": 1 } },
{ "$sort": { "submissionCount": -1 } }
]
| Setting | Description |
|---|---|
| Allowed Roles | Which roles can call GET /api/views/:slug/public |
| Public | No authentication required when checked |
| Row-Level — Owner | User sees only entries they created |
| Row-Level — Field Match | A specified entry field must match a user property |
An Action is a named sequence of steps that runs against a single collection entry. Actions are defined under Data → Actions and can be triggered from the entry list or via the [cta] shortcode on any public page.
Actions require a MongoDB connection configured in config/connections.json.
Steps run in order. If a step fails, execution stops and a partial result is returned with a stepsCompleted count.
| Type | What it does |
|---|---|
updateField | Sets a field on the entry to a new value |
deleteEntry | Permanently deletes the target entry |
moveToCollection | Moves the entry to a different collection |
webhook | POSTs entry data to an external URL |
email | Sends an email via the configured SMTP server |
All step field values support {{...}} interpolation:
| Variable | Value |
|---|---|
{{entry.data.fieldName}} | Any field from the target entry |
{{entry.id}} | The entry's UUID |
{{now}} | Current ISO 8601 timestamp |
{{user.name}} | Name of the triggering user |
{{user.email}} | Email of the triggering user |
{{user.id}} | UUID of the triggering user |
{{env.CMS_PUBLIC_*}} | Public environment variables |
updateField — mark an entry as approved:
{ "field": "status", "value": "approved" }
webhook — notify an external service:
{
"url": "https://hooks.example.com/notify",
"headers": { "X-Secret": "{{env.CMS_PUBLIC_HOOK_SECRET}}" }
}
email — send confirmation to applicant:
{
"to": "{{entry.data.email}}",
"subject": "Your application was approved",
"body": "Hi {{entry.data.name}}, your application has been approved."
}
The [cta] shortcode places an action-trigger button in any public page. Clicking it calls POST /api/actions/:slug/public with the entry ID, using the logged-in user's JWT.
If the user is not logged in, a warning toast is shown instead.
Wrapping form:
[cta action="slug" entry="entry-id" icon="check" confirm="Are you sure?"]Button label[/cta]
Self-closing form:
[cta action="slug" entry="entry-id" label="Button label" /]
| Attribute | Required | Default | Description |
|---|---|---|---|
action | Yes | — | Action slug |
entry | Yes | — | Entry UUID to act on |
label | No | "Run" | Button text (self-closing only) |
style | No | "primary" | primary · secondary · ghost · danger |
icon | No | — | Domma icon name |
size | No | — | sm · md · lg |
confirm | No | — | Confirmation prompt before executing |
Add per-entry buttons to any [collection] shortcode:
[collection slug="applications" display="cards" title-field="name"
cta="approve-application"
cta-label="Approve"
cta-icon="check"
cta-style="primary"
cta-confirm="Approve this application?" /]
| Attribute | Default | Description |
|---|---|---|
cta | — | Action slug — enables per-entry buttons |
cta-label | "Run" | Button label |
cta-icon | — | Domma icon name |
cta-style | "primary" | Button variant |
cta-confirm | — | Confirmation prompt |
All three display modes support CTA buttons: cards (card footer), list (inline), table (dedicated column).
See the public documentation for live examples and the complete attribute reference:
CTA Shortcode Reference