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.
following
I added a flag-attribute(enum), since I did not know any better.
Not the best Solution, but it works for me
Recommended threads
- I'm getting an error on the console "j?....
On my self hosted instance version 1.8.1 the console is giving me this error when trying to view the rows for a table I recently created. My application is read...
- local build `composer installer:dev` iss...
setup - dev container (default linux universal) WSL (test with gh codespace too) - php 8.5.7 - all extensions installed - `composer install` fine - `composer...
- Websites hosted on my appwrite sites hav...
Hello, all my websites hosted on appwrite sites are not running I am getting this message "This site can’t be reached drivehub.appwrite.network took too long t...