Hi, team I have a few wishes and I hope it would make its way into new versions of appwrite.
- Auto-delete documents after X amount of time.
- Whenever users login/ close an app, online status should be changed in appwrite.
- Logedin users latitude and longitude
TL;DR
1) Auto-delete documents after a certain amount of time:
- Create a function using Appwrite.
- Configure the function to run on a schedule, using the `appwrite.json` file.
- Inside the function, use the server-side SDK to query and delete documents that are older than a specified number of days.
2) Update online status when users login/close the app:
- Create a collection name `user_status`.
- Use the `updateDocument` function to set the user as online whenever they are active in the app.
- Create another scheduled function to set any document that has been updated in the last minute and is online to- You can achieve it be creating scheduled function 2-3. How it will work?
@Binyamin Thankyou for your response, I couldnt find a solution to learn how to do it, the function I mean.
- A online property of for all users, that could be used to update user data in database. So other users know who is online or offline.
- latitude and longitude of users current active device.
I mean but what part you want to be added in Appwrite You can achieve all those features like so:
Auto-delete
- Create a function
- Edit the
appwrite.jsonfile and set the schedule property to0 0 * * *for example so it will run every day at night - Inside the function use the server-side-SDK listDocuments function, and query any documents that are older then X days
- Delete all of them by ID
Login / Close app
- Create a collection name
user_status - Any time the user is online in the app use the
updateDocumentfunction to set the user as online. - Create another
schedulefunction and set any document that has updated in the last minute and it's online tooffline
Log Lat&Lng
- Create a collection named
user_lat_lng - Use the
updateDocumentfunction to update the user location every X [3. You can setschedulemethod that will go over the data and move it to a second database for data aggergation]
Recommended threads
- cant resume project
Invalid console fingerprint event i try man time
- Realtime for files() works almost well, ...
I have been trying to make use of realtime, today (14.03.26) I have pulled all the latest versions of docker images, and sdk available. Whats working: - Conn...
- general_route_not_found - Auth Guide
If you’ve just added a subdomain to your project, verified your DNS records, and confirmed your SSL certificate is working, but you're still hitting a `general_...