checking if stream exists in projection


I have a projection that creates new streams out of the body of another event, something like that:

Stream: source

Event: created : { codes : [ “a”, “b”, “c”] }




created: function (s, e) {

for (i = 0; i <; i++) {

emit(‘generated-’ +[i], “created”, {});


return s;



At some point, this projection was accidentally duplicated so I ended up with them clashing when trying to create new streams.

I deleted both projections and tried to create a new one. Now it immediately fails with

Multiple projections emitting to the same stream detected. Stream: ‘generated-a’. Last event projection: ‘6’. Emitting projection: ‘29’

One solution would be to create streams only if they don’t already exist. I can’t figure out how to do that.

Suggestions will be much appreciated.



Is this on 3.0.0?

No, rc2. Fair enough, I’ll check 3.0.0.

I think it will still fail on 3.0 I ask because I am wondering if the
delete of the projection might have failed. As of now its thinking
there is another projection running (the deleted one)