Explanation of linkMetadata property


i am curious of what $v, $c and $p properties stand for in the linkMetadata property, eg:

"linkMetadataRaw": "{\"$v\":\"3:-1:1:3\",\"$c\":173579527,\"$p\":173579527,\"$o\":\"accountstream-1555\",\"$causedBy\":\"e0a923eb-4f33-4bf5-a798-d59382faf059\"}"


They are used internally by projections.

Each of the properties you have listed, details information about the projection and who was responsible for the event being linked/emitted.

$v describes versioning information and is as follows:

$v[0] = Projection id.

The $projections-$all stream is basically a registration stream which stores a list of events that tells the projection subsystem which projections are still alive and needs to be loaded on startup. You will see events such as $ProjectionDeleted, $ProjectionCreated in that stream. The projection id is the event number of the $ProjectionCreated event for this particular projection.

$v[1] = Projectionepoch.

I can explain this a little more if you are interested.

$v[2] = Projectionversion

Every time the projection is updated, this number is incremented.

$v[3] = ProjectionSystem Version

Identifies the version of the projection sub system. Currently at version 3

$c = Commit Position
Commit position

$p = Prepare Position

Prepare position

Thanks Pieter.

I have use case that I hoped could be solved using those properties. I’ll open another thread for it.

Best, Aleš

Dne ponedeljek, 17. oktober 2016 17.37.57 UTC+2 je oseba Pieter Germishuys napisala:

Hi Pieter,
I found your reply while searching for information on how to construct the $v value - I hope you don’t mind if I reopen an old item… I’m really struggling to figure out how to get the projectionId of a named projection. The events that are created in the $projections-$all stream do not appear to have any link to the items in the /projections/any feed, so I cannot tie together a name, epoch and version (from the “any” URL) to the ProjectionCreated event. Is there some place else that I can query to tie together those values?