Deleting some, but not all, of streams linked to by projections

We have a projection that links to a series of streams, one per each value of an id field in an event.

The entities represented by those ids can be deleted, meaning its stream of links is no longer relevant and also needs clean-up.

My guess is things won’t break when deleting a link stream, as it’s not a system stream.

Is that a reasonable assumption? Thanks!

  • Bryan

I know for events that are linkedto in the projector, we had to add this check to ignore deleted events.

private static bool IsDeletedOrMetaDataEvent(ResolvedEvent e)

{

// It is possible for EventStore to write metadata events to a projection (I’ve only seen it done when a stream was deleted)

return e.Event == null || e.Event.EventType?.ToLower() == “$metadata”;

}

``