Metadata and Reserved Names
Every stream in Event Store has metadata associated with it. Event Store allows you to change some values in the metadata, and you can write your own additional data into stream metadata (such as how often to snapshot for your own code).
All internal data used by Event Store will is prefixed with a
$ character (for example
$maxCount on a stream’s metadata), because of this you should not use names with a
$ prefix as event names, metadata keys, or stream names, except where detailed below.
The supported internal settings are:
|$maxAge||Sets a sliding window based on dates. When data reaches a certain age it will disappear automatically from the stream and will be considered eligible for scavenging. This value is set as an integer representing the number of seconds. This value must be >=1.|
|$maxCount||Sets a sliding window based on the number of items in the stream. When data reaches a certain length it will disappear automatically from the stream and will be considered eligible for scavenging. This value is set as an integer representing the count of items. This value must be >= 1.|
|$cacheControl||This controls the cache of the head of a stream. Most URIs in a stream are infinitely cacheable but the head by default will not cache. It may be preferable in some situations to set a small amount of caching on the head to allow intermediaries to handle polls (say 10 seconds). The argument is an integer representing the seconds to cache. This value must be >= 1.|
If you set both
$maxCount then events will become eligible for scavanging when either criteria is met. For example, if you set
$maxAge to 10 and
$maxCount to 50,000, events will be marked as eligible for scavenging after either 10 seconds, or 50,000 events, have passed. Deleted items will only actually be removed once the scavenge process is run.
Security access control lists are also included in the
$acl section of the stream metadata.
|$r||The list of users with read permissions|
|$w||The list of users with write permissions|
|$d||The list of users with delete permissions|
|$mw||The list of users with write permissions to stream metadata|
|$mr||The list of users with read permissions to stream metadata|
You can find more details on access control lists can here.
Every event in Event Store can have metadata associated with it. Event Store supports some values being set in the metadata and you can write your own additional data into event metadata if you wish (such as the source of the event). All names starting with
$ are however a reserved space for internal details. The currently supported internal details are:
$correlationIdThe application level correlation ID associated with this message.
$causationIdThe application level causation ID associated with this message.
Projections will honor both the
causationId patterns for any events it produces internally (linkTo/emit/etc).