Deta Base supports storing items with an expiration timestamp. Items with an expired timestamp will be automatically deleted from your Base.
Items specify the expiration timestamp value in a field name
__expires in the item itself. The value is a Unix time, a number.
The item above will be deleted automatically on
2023-01-01 00:00:00 GMT (the equivalent date of the timestamp above).
Storing an item with an already expired timestamp will not fail but the item will be immediately deleted.
Base SDKs might offer higher level methods with easier APIs to specify the expiration timestamp. If they do so, they still store the timestamp in the item itself as mentioned above.
When you retrieve items with an expiration timestamp, the timestamp value will be present in the
__expires field. The value is a Unix time.
Query operations will not retrieve already expired items.
You can update the expiration timestamp with a new timestamp by updating the value of the
__expires as long as the item has not already expired.
Updating other fields of the item does not update (or renew) the expiration timestamp. You must update the value of
If you run into any issues, consider reporting them in our Github Discussions.