Skip to content

MultiStreamProjectionOptions

API reference for MultiStreamProjectionOptions

@delta-base/toolkit


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.

TDoc

TEvent extends Event

canHandle: EventTypeOf<TEvent>[]

Event types this projection handles


evolve: (document, event) => TDoc

Pure function: fold an event into the current document state

TDoc

ReadEvent<TEvent>

TDoc


getDocumentId: (event) => string

Derive the document key from the event (NOT the stream ID)

ReadEvent<TEvent>

string


initialState: () => TDoc

Initial state for a new document

TDoc


projectionName: string

Unique name for this projection (used for cursor tracking)

InlineProjectionOptions.projectionName


store: IReadModelStore

Read model store where projected data is written

InlineProjectionOptions.store