Project that reads data from a text file

Does EventStore support a projection that reads data from a file?

We are trying to write a projection that emits events based on finding events where the aggregate ids are fed through an external source. It could be a long list of items, so we are hoping we can load it from a file.


Could you not load the file into a stream(s) then use your projection to drive from that stream(s).
So just write a harness for loading the file and post the events (http) or via some aggregate. Then let the projection worry purely about the events.

Maybe I did not explain myself correctly. We are trying to use fromStreams where the streamnames could be a large number of streams. We can build the stream names from an external source (i.e. another database) but need a way to set the stream names from this list. Our hope is we could have a csv file or text file with the stream names and load them in the projection.

Could you give me an example. I am struggling to understand exactly what it is you need.

This is not supported. Even if you could read a file from the projection definition, that file would have to exist on the server. If you are running a cluster, you should also ensure that the file is exactly the same in each place since you don’t know which one will become leader first…

Why not build the projection dynamically in code (e.g. string.Format) and create the projection programmatically?

Thanks. We were building the projection dynamically but the number of streams involved in the projection would make the projection too large

We decided to go a different route. Thanks.