MultiStreamProjectionOptions
API reference for MultiStreamProjectionOptions
Interface: MultiStreamProjectionOptions<TDoc, TEvent>
Section titled “Interface: MultiStreamProjectionOptions<TDoc, TEvent>”Options for a multi-stream projection. One document aggregated from events across multiple streams. Uses globalPosition for cursor tracking.
Extends
Section titled “Extends”Type Parameters
Section titled “Type Parameters”TDoc
TEvent
Section titled “TEvent”TEvent extends Event
Properties
Section titled “Properties”canHandle
Section titled “canHandle”canHandle:
EventTypeOf<TEvent>[]
Event types this projection handles
evolve()
Section titled “evolve()”evolve: (
document,event) =>TDoc
Pure function: fold an event into the current document state
Parameters
Section titled “Parameters”document
Section titled “document”TDoc
ReadEvent<TEvent>
Returns
Section titled “Returns”TDoc
getDocumentId()
Section titled “getDocumentId()”getDocumentId: (
event) =>string
Derive the document key from the event (NOT the stream ID)
Parameters
Section titled “Parameters”ReadEvent<TEvent>
Returns
Section titled “Returns”string
initialState()
Section titled “initialState()”initialState: () =>
TDoc
Initial state for a new document
Returns
Section titled “Returns”TDoc
projectionName
Section titled “projectionName”projectionName:
string
Unique name for this projection (used for cursor tracking)
Inherited from
Section titled “Inherited from”InlineProjectionOptions.projectionName
store:
IReadModelStore
Read model store where projected data is written