Skip to content

How to use Parse.Query with pagination and order by pointer's field #1908

Closed
@phatnguyenbk

Description

@phatnguyenbk
+--------------------------------------------------------+
|                      _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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions