LiteDB icon indicating copy to clipboard operation
LiteDB copied to clipboard

TTL index

Open janstafa opened this issue 9 years ago • 1 comments

Hi, is there any way how to create a TTL index like in MongoDb or I have to implement a logic to remove old records myself? Thanks,, Jan

janstafa avatar Feb 14 '17 11:02 janstafa

Hi @janstafa, TTL indexes works in background process, deleting records when get defined age. But LiteDB works as an embedded document and there is no background process to be automatic.

I think you can create same extension method to collection that remove data using an conventional date index but you will need call when you want, not in automatic way.

Regards,

mbdavid avatar Feb 17 '17 23:02 mbdavid