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
- MariaDB refuses to connect to appwrite
Earlier, I tried updating my Appwrite version from 18.1.x to the latest release because my Flutter package required it to function properly. I used the official...
- executeFunction intermittently throws Fo...
Environment: Flutter app using the Appwrite Flutter SDK, calling executeFunction for [describe endpoint, e.g. live-stream-related function]. *Description*: Int...
- Console display all Databases as TablesD...
While looking at an issue with <@1231860789355347971> we saw that the console was displaying ALL databases as `TablesDB` even if the real type in the API is `le...