
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.
Recommended threads
- Login to appwrite CLI
Hi, appwrite login in cli seems not work for me on localhost when I tried `appwrite login --endpoint http://localhost --verbose` I got an error (file attached)....
- Unhandled Exception: type 'Null' is not ...
Hello I upgraded my instance from 1.6.2 to latest 1.7.4, doing migration. All seems to work fine but when I use the latest version of the appwrite plugin on my ...
- Database was Reseted to the Default Valu...
Hello, my database collections' documents are reset to the default attribute values by itself. Can someone help to investigate the issue, please?
