Grouping streams in EventStore

Greetings. The example is as follows:
I have 3 streams, each represents a user. Users 1 and 2 are a part of the red team, user 3 is a part of a blue team. There are two event types, that I receive in the streams (A and B).

Some time passes, stream have the following events in them:
1 - AABB
2 - AAAB
3 - BBAB

My goal is - to be able to filter each stream by event type (for example, filtering user 2 by event type A, I get AAA, by B -> B ), which, in my understanding, I can do, running a projection on a stream, making the “state” an array, checking every event by type and adding the ones of the fitting type (if there is a simpler way to make a filter by event type, please, let me know);
AND - To be able to filter the group of streams, in this example - the red team - by event type (so, filtering the red team by event type B -> BBB, By A -> AAAAA).

Is there a grouping mechanism for streams, that would allow me to be able to reference a set of streams, operating with them as if it is one stream (creating this “group tag” as I create the streams, without needing myself to go through all the existing streams one by one to find the ones, that are part of this group)?

you can run projection on set of streams with fromStreams selector.
it will take you events from all user1,user2,user3 streams.
Or you can use fromCategory if your user streams has same category, so you dont need to list each user, but get event from all users at once.
then you can add two handlers in when() filter.
Also, instead of adding events to state consider emitting events to new streams with linkTo() or emit()