ger
ger copied to clipboard
easy way to find_events that aren't expired?
I was looking through the find_events
method to check out how it handles expiries and their wasn't an obvious way to pull in all events that haven't expired. Does this exist? something i overlooked?
The find_events method should not return expired events, and in the options object you can pass size
and page
to scroll through the events. Also you can pass a current_datetime
object or string that can 'lock' a query to a specific time, so that inserting new data doesnt screw with your paging.
One of my initial assumptions was that there would be millions of events that haven't expired, so I didnt really see the need to pull all unexpired events. What do you need the functionality for?
Awesome that helps, i was thinking I needed to configure something for expiries. I have a getRecommendations
method that does the following but I thought i needed to configure it to pull in the non-expired events. Thanks!
- find previous non-expired events for the current user id
- do
events.map((ev) => ev.thing)
to get the user ids - Search for users in elasticsearch based on user preferences and exclude users with the previous list of ids
Definitely going to check out the pagination, I'll probably need that later on.