I’m trying to wrap my head around snapshots. It is my understanding that the proposed solution is to publish a snapshot to a separate stream.
My two questions are:
-
How do I know which event # the snapshot if of?
-
How do I query a stream starting with a given event number?
I am using HTTP api.
Example:
Consider an account #123, with some events:
A1: “account created”,
A2: “deposited $20”
A3: “withdrawn $10”
This would be published to “streams/account-123.”
I want to create a snapshot after A2. Would I push an event to “streams/account-snapshot-123” that looks something like this?:
{balance: 20, seq_number: 2}
How do I then query “streams/account-123” for events starting after the 2nd one only?