Aggregation streams?

Hi,

Currently I have one stream per aggregate instance in my app, and they
are all named like this:
myappname:aggregatetype-guid

Is there any way to get aggregation streams, for example "all events
for myappname", or "all events for aggregatetype"? I can't find
anything in the docs, but maybe I'm just looking in the wrong place.

We are currently making a Logstash input plugin for EventStore, and
rather than have it subscribe to $all and filter out what is not
needed (e.g. internal events), it would be nicer if we could just
point it to some "myappname" stream.

Ideas?

regards, Rickard

Projections offers you the simplest way of doing this.
For instance,

You could write a projection that will link your application’s events to a application specific stream.

if (!String.prototype.startsWith) {
String.prototype.startsWith = function(searchString, position){
position = position || 0;
return this.substr(position, searchString.length) === searchString;
};
}

fromAll()
.when({
$init:function(s,e){
return {
name: “”
}
},
$any:function(s,e){
s.name += e.streamId;
if(e.streamId.startsWith(‘MyApplication:’)){
linkTo(‘MyApplication’, e);
}
return s;
}
})

``

You could then subscribe to updates from that stream specifically.

Hi!

Thanks for fast response!

Projections offers you the simplest way of doing this.
For instance,
You could write a projection that will link your application's events to a
application specific stream.

if (!String.prototype.startsWith) {
    String.prototype.startsWith = function(searchString, position){
      position = position || 0;
      return this.substr(position, searchString.length) === searchString;
  };
}

fromAll()
.when({
    $init:function(s,e){
        return {
            name: ""
        }
    },
    $any:function(s,e){
        s.name += e.streamId;
        if(e.streamId.startsWith('MyApplication:')){
            linkTo('MyApplication', e);
        }
        return s;
    }
})

You could then subscribe to updates from that stream specifically.

Ok, I'll look into this once your website is up again
(geteventstore.com is down, which has all the blog entries).

So right now it is mandatory basically to use projections to do
something like this? But that feature has not been released for
production use yet if I understand it correctly.

The alternative I can think of without using projections is to add
MyApplication as metadata on all events, and let client subscribe to
$all and filter on that. Not as efficient, but doesn't require
projections.

No other alternatives?

regards, Rickard

Nope. You either have to filter it on the server (projection) or filter it on the client.