Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

querying / filtering events by type #1639

Closed
schmitch opened this issue Dec 4, 2020 · 3 comments
Closed

querying / filtering events by type #1639

schmitch opened this issue Dec 4, 2020 · 3 comments

Comments

@schmitch
Copy link

schmitch commented Dec 4, 2020

currently I'm working on a small reporting tool that will output some of our events (create and change events for a specific type) into a csv specific by a start time and end time.

Unfortunatly via QueryRawEventDataOnly it's not possible to filter by multiple types. and QueryAllRawEvents does not expose the type parameter.

At the moment the only thing it might be possible would be to do client side filtering:

var events = await session.Events
   .QueryAllRawEvents()
   .Where(t => t.Timestamp >= firstDayOfMonth && t.Timestamp < firstDayOfNextMonth)
   .ToListAsync();
            
events.Where(t => t is Event<TenantCreateEvent> || t is Event<TenantChangeEvent>).ToList()

it would be at least great to expose the type param to IEvent

@jokokko
Copy link
Collaborator

jokokko commented Dec 4, 2020

Hmm, not knowing the application, have you tried or considered just going with projections? E.g. see the example https://martendb.io/documentation/events/projections/projectionbyeventtype/ that projects by a time window.

@jeremydmiller
Copy link
Member

And I still like this idea, but I'm unilaterally kicking it back to 4.1

@jeremydmiller jeremydmiller modified the milestones: 4.0, 4.1.0 Mar 1, 2021
@mdissel
Copy link
Contributor

mdissel commented Mar 2, 2021

Maybe support query by interface ? see #623

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants