Using the node.js event-store-client. When calling readStreamEventsForward you get a structure called StoredEvent. There is one property here called eventNumber (it says “number” in the docs, but in my tests, it’s “eventNumber”).
If I run this method on a projection-generated stream with resolveLinkTos = true, then the “eventNumber” field is populated by the original linked stream’s event numbers. If I set resolveLinkTos = false, then I get my projection-generated stream’s event numbers (which I want!) but can’t access the linked event data.
I’m not sure if there’s any way I can get both the projection stream’s event numbers (which I need for keeping track of my read model) and the linked event data.
The workaround I might have to use for the short term is using emit(…) in my projection, instead of linkTo(…) to create copies of the events instead of references. Is there a better way?