Skip to content

Projections

A projection is a declarative read-model builder driven by events. It defines how event data maps onto a read model: which fields to set, how to handle collections, when to create or delete instances, and which event types to subscribe to. Chronicle evaluates projections as events arrive and keeps the resulting read models up to date.

Lists all projection definitions registered in the specified event store and namespace.

Terminal window
cratis chronicle projections list
FlagDescription
-e, --event-store <NAME>Event store to inspect. Defaults to default.
-n, --namespace <NAME>Namespace to inspect. Defaults to Default.

Use --output plain when you need to enumerate projections by name. The JSON format includes the full projection definition blob for each entry, which is significantly larger than the plain output. Use JSON only when you need the complete definition.

Terminal window
cratis chronicle projections list --output plain

List all projections:

Terminal window
cratis chronicle projections list

List in a specific event store:

Terminal window
cratis chronicle projections list -e myapp

Get projection identifiers for scripting:

Terminal window
cratis chronicle projections list -q

Shows the full projection declaration for a single projection, including all event mappings, child projections, and filters.

Terminal window
cratis chronicle projections show <IDENTIFIER>
ArgumentDescription
IDENTIFIERThe projection identifier. Use projections list -q to retrieve identifiers.
FlagDescription
-e, --event-store <NAME>Event store to inspect. Defaults to default.
-n, --namespace <NAME>Namespace to inspect. Defaults to Default.

Show a projection definition:

Terminal window
cratis chronicle projections show my-projection-id

Get the full definition as JSON:

Terminal window
cratis chronicle projections show my-projection-id -o json