Hi,
given following projection:
options({
$includeLinks: false,
reorderEvents: false,
processingLag: 0
});
fromCategory('my_events')
.partitionBy(({ data }) => data.Id)
.when({
$init: () => {
return {
data: {
Id: null,
Version: 0,
Key: null,
Title: null
}
};
},
ItemAdded: (state, { data }) => {
state.data = {
Version: state.data.Version + 1,
...data
};
},
ItemEdited: (state, { data }) => {
state.data = {
Version: state.data.Version + 1,
Key: state.data.Key,
...data
};
},
})
.transformBy(({ data }) => {
return { Data: data };
})
.outputState()
.outputTo('item_state', 'item_state-{0}');
How can I write specific metadata to the output stream ‘item_state-{0}’?