Uploaded image for project: 'Realm Core'
  1. Realm Core
  2. RCORE-1455

Sort by computed properties

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      We should allow queries to support sorting on a computed property. 

      This type of advanced sorting would enable use cases like this:

      • {{"location geoWithin Geospatial("polygon", [...] SORT(distance(location, GeoPoint(x,y)))" }} // sort by distance function of geospatial point
      • "price - discount < 10 SORT(price - discount)" // sort by numeric computation between properties
      • "name CONTAINS[c] 'on' SORT(name.@size)" // sort on length of string
      • "TRUEPREDICATE SORT(myList.@size)" // sort on size of list property
      • "TRUEPREDICATE SORT(myMixedProp.@type ASC, myMixedProp ASC)" // sort on type of mixed property (tracked https://github.com/realm/realm-core/issues/4586)

            Assignee:
            Unassigned Unassigned
            Reporter:
            james.stone@mongodb.com James Stone
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: