I am relatively new to EventStore and would like to read the events from multiple streams to rebuild a read model. I am struggling with how to do this and I can’t seem to get the examples I have found to work.
For example, the following wiki page shows how to use the esquery command line tool to append four events into multiple streams and then read them back. However, when I run through the example I do not get the events returned, I only see the last event:
es:> append foo1 MyType {‘foo1’ : ‘data1’}
Succeeded.
es:> append foo MyType {‘foo’ : ‘data2’}Succeeded.
es:> append foo1 MyType {‘foo1’ : ‘data3’}Succeeded.
es:> append foo MyType {‘foo’ : ‘data4’}Succeeded.
es:> q fromStreams([‘foo’, ‘foo1’])Query started. Press esc to cancel.
Query Completed in: 00:00:01.1369890
Result:{
“foo”: “data4”
}Query Completed
I have all the standard projections enabled, and will ultimately be needing to combine $et- streams together.
So, my questions are:
- How do I create a query that combines multiple, known, streams (I am assuming this is possible and ordering by time will occur automatically)?
- Do I even need a query or can this be done via some other mechanism? (I would rather not have a long running projection combining streams if possible as the projection does not need to be running all the time)
- How to create the query and read the results via the .Net API?
Many thanks!
Cameron