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
- [Self-hosted] Realtime crashes with "Mis...
- Error trying to deploy functions from CL...
✗ Error • on-auth-create (6a00b2ab000c9ce2949b) • Server Error ✗ Error: No functions were pushed. Prject ID: 69ffe0270033a4ac420a
- Intermittent Deploy and Execution Errors...
Project: project-fra-658e2f5f4ba30df91177 Function ID: 69bde006001c56757f49 **Several execution errors with:** Timed out waiting for runtime.\nError Code: 400...