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.
cratis chronicle projections listOptions
Section titled “Options”| Flag | Description |
|---|---|
-e, --event-store <NAME> | Event store to inspect. Defaults to default. |
-n, --namespace <NAME> | Namespace to inspect. Defaults to Default. |
Output tip
Section titled “Output tip”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.
cratis chronicle projections list --output plainExamples
Section titled “Examples”List all projections:
cratis chronicle projections listList in a specific event store:
cratis chronicle projections list -e myappGet projection identifiers for scripting:
cratis chronicle projections list -qShows the full projection declaration for a single projection, including all event mappings, child projections, and filters.
cratis chronicle projections show <IDENTIFIER>Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
IDENTIFIER | The projection identifier. Use projections list -q to retrieve identifiers. |
Options
Section titled “Options”| Flag | Description |
|---|---|
-e, --event-store <NAME> | Event store to inspect. Defaults to default. |
-n, --namespace <NAME> | Namespace to inspect. Defaults to Default. |
Examples
Section titled “Examples”Show a projection definition:
cratis chronicle projections show my-projection-idGet the full definition as JSON:
cratis chronicle projections show my-projection-id -o json