1

I Use parse-server version 2.2.25 and parse iOS SDK version 1.14.2

I would like sort all objects on my Cart on field desc of the object Catalog.

My Simplified Database Structure is :

Catalog (Table)

+--------------+--------------+
|idkey (String)| desc (String)|
+--------------+--------------+
|   1          |    a         |
|   2          |    b         |
|   3          |    c         |
+--------------+--------------+

Cart (Table)

+--------------+------------------------------+
|Qty (Number)  | Catalog (object -> PFObject) |
+--------------+------------------------------+
|   2          |            1                 |
|   2          |            2                 |
|   4          |            3                 |
+--------------+------------------------------+

I try many solutions without good solution.

PFQuery *query = [PFQuery queryWithClassName:@"Cart"];
[query includeKey:@"Catalog"];
[query addAscendingOrder:@"desc"];
         or
[query addAscendingOrder:@"Catalog.desc"];

So, I can't sort locally for 2 reasons :

  1. Many records > 100.000

  2. I use ParseUI (PFQueryTableViewController / PFQueryCollectionViewController), with pagination (25/40 record per page).

Any suggestions?

Robert N
  • 51
  • 1
  • 6

1 Answers1

0

according to parse docs:

Note that we do not, however, support GeoPoint or non-filtering constraints (e.g. nearGeoPoint, withinGeoBox...:, limit, skip, orderBy...:, includeKey:) in the subqueries of the compound query.

In your case you are trying to sort a pointer so it looks like it is not supported by Parse yet..

Ran Hassid
  • 2,788
  • 1
  • 12
  • 20