Read all events of stream type

Hi,

is there a way of reading all events of a certain stream type? I’m looking for something like the

StreamFilter.Prefix

possibility for e.g.

SubscribeToAllAsync

If I’m not mistaken there is no wildcard

eventStoreClient.ReadStreamAsync(Direction.Forwards, "Client-*", StreamPosition.Start);

Thanks
Dani

Dani,

This any good?

https://developers.eventstore.com/clients/grpc/subscribing-to-streams/filtering.html#filtering-out-system-events

@Dani, currently, we don’t support filtering on reading events from multiple streams. You cannot use the regular Stream API as it’s designed and optimised to read from the specific stream.

We already had such an internal discussion about adding filtering for reading from the $all stream. However, it’s not as trivial as it may seem. Technically, ReadAllAsync is reading all events. Even if we add a filter there, then it may take quite some time to read all events from the beginning. What’s more, gRPC currently does not allow sending progress while reading. We may consider adding that in the future.

I’d suggest either use:

Hi @oskar.dudycz

Thank you, the category projection is what I was looking for.

It looks like:

        var events = eventStoreClient.ReadStreamAsync(Direction.Forwards, "$ce-TechnologyGroup", StreamPosition.Start, resolveLinkTos: true);
        await foreach (var @event in events)
        {
            var eventType = Type.GetType($"{@event.Event.EventType}");

            IDomainEvent domainEvent = (IDomainEvent)JsonConvert.DeserializeObject(
                Encoding.UTF8.GetString(@event.Event.Data.ToArray()),
                eventType);
        }

Regards
Dani