Hi,
Are there any implemented way of expiring data in your GunJs database? The Epoch timestamp could of course be used to manually check if you should expire and remove some data, but are there any way the library offers to expire data in your database by giving it an expire time?
Thanks!
@Ronsku great question, not currently, however that is one of the many aspects that v0.8.x series will address. And one that @lmangani has been asking for.
Deletes are actually a tad tricky in a distributed database. But for v0.8.x I'm trying to make them work for certain assumptions/server setups. This will make it easy to implement a TTL extension for expiry data.
So stay tuned! Or would love it if you could help out, too.
@Ronsku , @amark well.... with gun-tag you could easily do just that....just untag nodes on a certain date ;p
@amark Is TTL available now? It's very important in our use case (to reduce size of useless expired data on gun), without TTL we must find another decenterialized instance message protocol instead of use Gun.time
@Jack-Works there is lib/later but I don't think it does what you want, and its trivial 10 lines is embarrassing: https://github.com/amark/gun/blob/master/lib/later.js
It'd be helpful if you guys could contribute back a module, it should be easily possible to write a module that just "drops" syncing any data with null (or some special symbol) in it and a time/vector larger than X age.
Slightly harder thing might be adding nodes in a graph to a "trash" bin/tag/label, to then have a special garbage collector delete it from disk. But many would love you for it, if you could do this.
Unfortunately, I'm gonna have to close this issue, it has been open way to long, nobody has helped me build it, and it is more of a feature request than a bug. A very important feature that I absolutely hope to support one day, but I'm too overwhelmed and either it will come when it comes or somebody helps sit down and code it with me. If you want to do that, please tag me here / reopen again. Thanks, sorry!
Most helpful comment
@Ronsku , @amark well.... with gun-tag you could easily do just that....just untag nodes on a certain date ;p