Closed
Description
+--------------------------------------------------------+
| _User class |
+----------+---------------+-----------+-----------------+
| objectId | totalFavorite | totalView | totalConversion |
+----------+---------------+-----------+-----------------+
- User.totalFavorite is sum of Post.favoriteCount by each user.
- User.totalView is sum of Post.viewCount by each user.
- User.totalConversion is sum of Post.conversionCount by each user.
+-----------------------------------------------------------------------------------+
| Post class |
+----------+--------------------------+---------------+-----------+-----------------+
| objectId | createdBy (User Pointer) | favoriteCount | viewCount | conversionCount |
+----------+--------------------------+---------------+-----------+-----------------+
Relation between of _User and Post is one-many
I want to get all of posts with sort by popular-user ranking (priority: totalConversion < totalView < totalFavorite) and Pagination.
I do not have any idea for the best solution (easy and fast).
Please help me. Thanks all.