Hey guys, I just build a social app where users can post videos, share image and text, users can like, share and comment on post, but I want a situation to show the numbers of view on a post.
Please how do I achieve this?
Everytime the post comes in to view, check if the currenr user has already "seen" it. If not, add a new item. Incrementing count on every seen would inflate the view count exponentially due to duplicity.
Maybe add an array attribute in the same post document, or create a relation with a collection or a complete separate collection for the same.
An array based attribute could get harder to manage though if the size grows substantially.
Recommended threads
- The console isnt showing documents
In console ui saved documents are being shown on frontend but i can see its showing 4 or number of docs available but in rows its only showing single doc and th...
- 1.8.1 - Databases - inline updating a ro...
When updating a database field via the inline edit method, the `$updatedAt` column does not get updated. Only if the row is updated by the "Update" interface (t...
- Build failed
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory