# Feature request: auto delete collection

**URL:** <https://forum.weaviate.io/t/feature-request-auto-delete-collection/7426>\
**Category:** General\
**Tags:** developer-experience\
**Created:** [November 4, 2024, 12:53am UTC](https://forum.weaviate.io/t/feature-request-auto-delete-collection/7426 "2024-11-04T00:53:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Agam\_More](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/agam_more/32/2797_2.png) [@Agam\_More](https://forum.weaviate.io/u/Agam_More)\
**Post date:** [November 4, 2024, 12:53am UTC](https://forum.weaviate.io/t/feature-request-auto-delete-collection/7426/1 "2024-11-04T00:53:32Z")

</div>

I have a use case where I need to delete the collection I used after use.  
Is there a way to set an expiration time for a collection so it will be deleted each time? I don’t need the data after doing some queries over it, and my code might hit an exception so i’d love for this to be handled by weaviate so I don’t have orphaned collections I didn’t delete.

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [November 4, 2024, 1:58pm UTC](https://forum.weaviate.io/t/feature-request-auto-delete-collection/7426/2 "2024-11-04T13:58:05Z")

</div>

hi @Agam_More !!

Welcome to our community 🤗

We do not have this feature, and this is not in [our roadmap](https://weaviate.io/developers/weaviate/roadmap).

I believe that it would be best to handle that action to an external task than leveraging to the database itself 🤔

If there is a place in your code you know the collection can be deleted already, you can call an async task to drop the collection.

What kind of exceptions have you faced?

---

<div class="post-metadata">

**Author:** ![Agam\_More](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/agam_more/32/2797_2.png) [@Agam\_More](https://forum.weaviate.io/u/Agam_More)\
**Post date:** [November 4, 2024, 11:42pm UTC](https://forum.weaviate.io/t/feature-request-auto-delete-collection/7426/3 "2024-11-04T23:42:49Z")

</div>

Adding something like `pg_cron` would allow this and more things.  
Detaching it from the DB puts data lifecycle demands on the application layer, which seems not directly tied.

My problem is if I get an exception that is unhandled, it might not reach the deletion portion of the code.
