Time to live (TTL) records not deleting automatically

Hello!

I recently deployed an app in production using FaunaDB as the primary DB. The app includes a collection called “storeEvents” which I set the TTL to 2 (days).
I did this expecting records to be automatically deleted after 2 days of their last write as it says in the help popup but after over a week, I still have storeEvents which have not been deleted.

Do I need to implement a cron task in my app to delete old storeEvents? I was hoping I could rely on the TTL feature but it doesn’t seem to be working.

I was on the free plan and had exceeded my write ops, so I’m suspicious if that was the cause of the issue but after upgrading to a paid plan, I don’t know if I should expect the old records to be deleted sometime soon or not.

Thank you for your advice and help!
Ari

Hi @Acidic9 ,

TTL expiration is handled by a background job, and it might take hours or days before the deletion is effectively done.

You may take a look here (for collections) and here (for documents)

Let me know if this answers your question.

Luigi

Bubbling this back up because I want to understand what the documents say about TTL. To quote:

As of version 3.0.0, the ttl field is honored on read — a document that should have been removed behaves as if it has been removed. However, until removal actually occurs due to background task processing, you can continue to access the history of the document, provided you have its reference, via the Events function.

What does it mean by ‘read’ here? Is that in the Dashboard? On a JS query? In the shell? Because on all three, I’m seeing a document that is past its TTL.

Also bubbling this back up because my records are still yet to be deleted even after living for 15 days (while the TTL is 2 days). Seems like there’s something wrong or something I’m not understanding regarding this.

Hi @caelon @Acidic9,

would you share with me a temporary key in private and I can take a look?

Thanks,

Luigi

Mine was resolved. For the entries I was looking at, the TTL was in the wrong layer of the JSON. Thank you.