Hi All,
I have a problem with 2 projections linking events to one stream. Is it possible in EventStore at all?
Used projections:
1:
fromStream(‘Devices’)
.when({
$any : function(state, ev) {
linkTo(‘User-’ + ev.metadata.userID, ev);
linkTo(‘Device-’ + ev.data.id, ev);
}
})
2:
fromStream(‘DeviceLinks’)
.when({
$any : function(state, ev) {
linkTo(‘User-’ + ev.metadata.userID, ev);
linkTo(‘Device-’ + ev.data.parentId, ev);
linkTo(‘Device-’ + ev.data.childId, ev);
}
})
Error received:
Multiple projections emitting to the same stream detected. Stream: ‘Device-49f657c7-daa7-433b-8cec-cef304d193c9’. Last event projection: ‘7’. Emitting projection: ‘6’
All, that I’m doing is putting two events in Devices stream and one event to and DeviceLinks that should link them. I’m trying to achieve that in stream Device-guid i would see events like: DeviceCreated, LinkCreated, etc.
Cheers,
Karolis