Delete older streams from Eventstore

I’m new to using Eventstore. I have a requirement where I have to delete streams older than 4 months in the Eventstore. Is there any way to do programmatically do it using C# or any command that we can perform when the Eventstore performs stats event?

You can set in metadata $maxAge on a stream and events will automatically disappear when they are older than the time period (seconds)

Thank you Greg. Also, another question was that I see a huge data files being created in the data folder of the eventstore folder. If I run the $maxAge will it help me reduce the storage consumption or do I need to run the scavenge command to do that?

Hi,

No *huge* chunk files should be created (except for the index), but if you run scavenge (on admin tools from the UI or see the wiki for the URI to hit) it will go through and clean up both the index and the data chunks.

Cheers,

James