3 ms·
You probably already add a "time created" column/field to each row/document (at least, I personally do this to all data I store in a database). If you want to
by pan69 9y ago
You probably already add a "time created" column/field to each row/document (at least, I personally do this to all data I store in a database).
If you want to expire something, you can now easily calculate it and you can even easily change the timeout/lifespan without having to update the data in the database.
- raverbashing 9y agoHow would that help? Would you set time created to zero?
- pan69 9y agoRather than having an expire date, with a creation time you can e.g. delete everything older than 1 day, or what ever. I.e. you don't hard code the expire time in the data itself. If you want to change the timeout to 2 days it's a change in your delete logic, not your data.