Sean Knowles
Sean Knowles15mo ago

Is there TTL can we set for record inserts?

Is there anyway to set the TTL for record mutations, trying to auto delete data persisted to the database after 30 minutes.
3 Replies
erquhart
erquhart15mo ago
You can effectively have TTL by scheduling deletion at the same time as insertion. You can use the runAfter method to run a delete record mutation. Docs here: https://docs.convex.dev/scheduling/scheduled-functions#scheduling-from-mutations
Scheduled Functions | Convex Developer Hub
Convex allows you to schedule functions to run in the future. This allows you to
jamwt
jamwt15mo ago
GitHub
convex-demos/scheduling/convex/messages.ts at main · get-convex/con...
Demo apps built on Convex. Contribute to get-convex/convex-demos development by creating an account on GitHub.
jamwt
jamwt15mo ago
sendExpiringMessage schedules a delayed deletion mutation upon insertion

Did you find this page helpful?