how to delete document after certain time in a collection
- 0
- Self Hosted
- Flutter
- Databases
- Functions
how can i achieve this the best way are there any limitations?
You can mark the document that needs to be deleted and then create a function that can delete marked documents in bulk, and then schedule that function using cron: learn more about scheduling here: https://appwrite.io/docs/products/functions/execute#schedule
how do i mark a document?
okay, so for example create new collection called "delete-this-docs" that no one can access, and create attribute to store the document path. now you can keep adding docs here that you want to delete and then you can read this collection from Appwrite server SDK inside appwrite function, and delete all those docs from path stored and also delete record of that docs from "delete-this-docs" collection.
Learn more about server SDK here: https://appwrite.io/docs/sdks#server Learn more about function here: https://appwrite.io/docs/products/functions/functions
ill take a look at it thanks
edited
ok
Recommended threads
- 1:1 relationship doesn’t sync after re-a...
Hi, I’m trying to use a two-way one-to-one relationship. It works fine when I create a record with the relationship set, and it also works when I unset it. But ...
- Upsert with setting permissions
Hi there, I am using self-hosted appwrite v1.7.4 and trying to use the bulk update stuff that was released with 1.7.x. Unfortunally I found that there is an ser...
- Function deployment failed: Unable to re...
Hi Appwrite team, I have been experiencing persistent errors when i attempt to push my appwrite functions. The logs on the deployment detail page on the console...