In the example app we highlight the importance of the revision field for projections.
export const User = z.object({
_id: z.string().length(24),
id: z.string(),
// The revision is an important bit of
// information. We set the latest event id
// from the EventSourcingDB related to this user
// here.
// This is used to resume the projection if the
// application is restarted. We do not want to
// apply all events again but pick up where we left off.
//
// See also getUserProjectionLowerBound() in users.projection.ts
// for additional details on this.
revision: z.string(),
email: z.string(),
firstName: z.string(),
lastName: z.string(),
invitedAt: z.string(),
acceptedAt: z.string().nullable(),
});
Would it be good to add some abstraction for projections to Nimbus?
How should this look like, e.g. a type or interface that could simply be extended?
In the example app we highlight the importance of the
revisionfield for projections.Would it be good to add some abstraction for projections to Nimbus?
How should this look like, e.g. a type or interface that could simply be extended?