I have deleted some streams but I'm still getting those streams when my projection starts.
Is there a way to filter out any deleted streams from projections?
I know that the streams have been deleted because a StreamDeletedException exception is being raised when I use code like this:
var events = _eventStoreConnection.ReadStreamAsync(
Direction.Forwards,
e.Event.EventStreamId,
StreamPosition.Start);
await foreach (var @event in events)
{
}
Your question needs a lot more context than what you provided.
A bit of clarification. Projections don't store streams. Projections don't store events either. Projections are computation that happens to emit events to stream(s).
It seems you are relying on
$streamsor something similar that linked events from streams you deleted. The distinction is important because what is stored in streams like$streamsare actually links that point to events belonging to different streams. As such, when streams got deleted, the links that point to their events are not deleted.In the case of
$streams, what is stored is links to each stream first event. Links are events with a payload following this pattern{version_number}@{stream_name}and with the$>event type.In EventStoreDB you can't delete events as you would delete a row in an SQL database, but you can delete streams (which you can see as tables if it helps)