Answer the question
In order to leave comments, you need to log in
How can I delete temporary information in the database?
What are the schemes for working with temporary information in the database?
For example, the user object has a SUBSCRIPTION field - it is an array of objects with id, name and expire properties. Expire is the unix time in seconds, which is calculated by Date.now() + SUBSCRIPTION TIME
To clean the database from inactive subscriptions, I came up with 2 methods:
1. In the first request to the server, let's say get_user, we compare expire with the time now, if less - delete and save the user.
2. This is a background script that runs through users and also compares and deletes, saves.
These methods can be combined
. Are there any other ways to process such "temporary" information?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question