Skip to content
Back

Best Practice for Monitoring document changes

  • 0
  • Self Hosted
  • Functions
  • Databases
  • Apple
Eric
11 Aug, 2025, 10:32

Just wanted to ask about the best-practice for keeping track of changes of a document. E.g. a document is a blog post and users can "like" it. Currently I am saving the userIds in an array to keep track, who is liking it. But now I want to create an Activity-View to tell other users "user xy liked the post xy". My plan was to create a function which is triggered when the blog post document is changed, and create the right Activity-documents for the other users on the server-side. But I can't check what is changed, since it could be anything.

So now I am stuck between a few options:

  • change the like-array into something more complex (e.g. array with id;timestamp;isNew-Bool)
  • add a flag-attribute (e.g. an last-update-type = "newLike")
  • Create the Activites when the user is pressing the like-button (which I dont want, since its more load on the client-side)
  • separate collection for likes (same argument as above, additional load on client-side)
  • ...

But I hope there is a more simpler approach which I am missing right know. Thank you.

TL;DR
Developers seeks advice on monitoring document changes for tracking likes on a blog post. Considering different options like changing array structure, adding flag attribute, or creating activities on like button press. Looking for a simpler approach. **Solution:** Consider using a flag attribute to track changes or redesign the array structure to include more detailed information such as id, timestamp, and isNew bool.
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