I am trying to read all the events in my EventStore. Here is how I am trying to accomplish this
connection.readAllEventsForward(
-1,
-1,
1000000,
false,
false,
e => console.log(“EVENT”, e),
credentials,
() => console.log(“All events read”)
);
I always get to the “All events read” message, but nothing happens for each event in the store. I am positive there are events in the store, so something should come out. Is this being processed incorrectly with the function logging out the events? What am I doing wrong?
Maybe I don’t fully understand what readAllEventsForward does? When I changed the callback to be
completed => console.log(completed)
, there was an empty array of events in the completed object. I thought readAllEventsForward, read all of the events. Am I mistaken? If I am mistaken, how do I get all the events out of the ES?
And I have an error.
error: ‘Read size too big, should be less than 4096 items’
I assumed I could read as many items as I wanted. Is there a way to go through all of the events in the store?
that is the batch size not the total number to read
So in
connection.readAllEventsForward(
-1,
-1,
1000,
false,
false,
e => console.log(“EVENT”, e),
credentials,
() => console.log(“All events read”)
);
The third argument is batch size. I assume that means that the streams are returned from the ES in batches of whatever that 3rd parameter is. Is this correct? Bc if I change that number to something small, like 100, then it seems to only return 100 events. I can verify that it doesn’t return all of the events. The parameter name is maxCount, so I assumed it was the total number of events that would return.
So in
-1,
-1,
1000,
false,
false,
e => console.log(“EVENT”, e),
credentials,
() => console.log(“All events read”)
);
connection.readAllEventsForward(
The third argument is batch size. I assume that means that the streams are returned from the ES in batches of whatever that 3rd parameter is. Is this correct? Bc if I change that number to something small, like 100, then it seems to only return 100 events. I can verify that it doesn’t return all of the events. The parameter name is maxCount, so I assumed it was the total number of events that would return.