delete objects/records by date
Hi, I am a newbie. Thus I apologize if this is obvious. What is the best way (and how) can I delete records older than the current date? Say I have an index of events. But I only want to show events in the future or that that are currently happening. Each event has a timestamp attribute. How do I make sure to always delete events that have expired? Does algolia provide such a service? or do I have to run a cron job everyday that gets all records and deletes the older ones? Isn't this costly?
you can run the "deleteBy" function periodically with a filter that has the timestamps before today, filters: "date <" + Date.now() / 1000 (or similar).
See the documentation here: https://www.algolia.com/doc/api-reference/api-methods/delete-by/?client=javascript