Uploaded image for project: 'Realm Java SDK'
  1. Realm Java SDK
  2. RJAVA-1018

Invalid predicate error on try to sort by field with name "sort".

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

      Goal

      Want to receive a sorted list from db.

      Actual Results

      App is crashed with this log:
      Caused by: java.lang.IllegalArgumentException: Illegal Argument: Invalid predicate: 'TRUEPREDICATE SORT(sort ASC)': syntax error, unexpected sort in /tmp/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_TableQuery.cpp line 527

      Steps & Code to Reproduce

      For reproduce you can try to create a class that extents RealmObject, add field (var sort: Int = 0). Then try to fetch this objects with query with .sort() function call.

      Version of Realm and tooling

      Realm version(s): 10.7.1

      Realm Sync feature enabled: No

      Android Studio version: 2020.3.1

      Android Build Tools version: 30.0.3

      Gradle version: 7.0.2

      Which Android version and device(s): 11

            Assignee:
            james.stone@mongodb.com James Stone
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: