Back

Feature wishlist

  • 0
  • Tools
  • Databases
  • Cloud
  • Locale
  • Self Hosted
Nuaiman
24 Aug, 2023, 14:14

Hi, team I have a few wishes and I hope it would make its way into new versions of appwrite.

  1. Auto-delete documents after X amount of time.
  2. Whenever users login/ close an app, online status should be changed in appwrite.
  3. 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
Binyamin
24 Aug, 2023, 14:55
  1. You can achieve it be creating scheduled function 2-3. How it will work?
Nuaiman
24 Aug, 2023, 14:59

@Binyamin Thankyou for your response, I couldnt find a solution to learn how to do it, the function I mean.

  1. 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.
  2. latitude and longitude of users current active device.
Binyamin
24 Aug, 2023, 15:07

I mean but what part you want to be added in Appwrite You can achieve all those features like so:

Auto-delete

  1. Create a function
  2. Edit the appwrite.json file and set the schedule property to 0 0 * * * for example so it will run every day at night
  3. Inside the function use the server-side-SDK listDocuments function, and query any documents that are older then X days
  4. Delete all of them by ID

Login / Close app

  1. Create a collection name user_status
  2. Any time the user is online in the app use the updateDocument function to set the user as online.
  3. Create another schedule function and set any document that has updated in the last minute and it's online to offline

Log Lat&Lng

  1. Create a collection named user_lat_lng
  2. Use the updateDocument function to update the user location every X [3. You can set schedule method that will go over the data and move it to a second database for data aggergation]
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more