Open sancho1952007 opened 1 year ago
@sancho1952007 you can write code to manage the expirations yourself. Include timestamps in the keys or build a map/reduce view to output the documents you need to expire--and then remove them accordingly.
Yes but you have to use methods like setIntervals() right?
I mean, me and many other developers would prefer something like expires, expiresIn, ttl and the number of seconds or something like that. It would be great adding such a feature instead of fetching the whole database just to delete a value.
Especially on a large scale, fetching the database so many times isn't possible!
The view results aren't the whole database. Also, PouchDB isn't a cache...but it sounds like a cache is really what you want.
It's OK to use more than one database. :)
From: Sancho Godinho @.> Sent: Saturday, March 25, 2023 11:52:52 PM To: pouchdb/pouchdb-server @.> Cc: Benjamin Young @.>; Comment @.> Subject: Re: [pouchdb/pouchdb-server] Please add support for expiring items! (Issue #470)
Yes but you have to use methods like setIntervals() right?
I mean, me and many other developers would like something like expires, expires in, ttl or something like that. It would be great adding such a feature instead of fetching the whole database just to delete a value.
Especially on a large scale, fetching the database so many times isn't possible!
— Reply to this email directly, view it on GitHubhttps://github.com/pouchdb/pouchdb-server/issues/470#issuecomment-1483987016, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAAKRSJ5JKRLPMFGZIWEJRTW564RJANCNFSM6AAAAAAVYHS6WY. You are receiving this because you commented.Message ID: @.***>
Can you show an example of how I can do it please?
Request
Currently No Support For Expiring Items.
This is a very important and required feature any database should have! I'm planning to build something massive using this database but the only one thing that stopping me do it is expiring items because when you make apps at a scale, you need temporary auth keys, login session IDs, etc. due to which expiration becomes an important factor.
Hope you'll accept my requirement 🤗