Cannot use the LIMIT operator in Realm Query Language

The developer documentation mensions a LIMIT operator for Realm queries. https://www.mongodb.com/docs/atlas/device-sdks/realm-query-language/#sort--distinct---limit
But when using it, the code throws exceptions.

The code:

listQ.Filter("LIMIT ($0)", offset);

Resulting Exception:

Invalid predicate: 'LIMIT ($0)': syntax error, unexpected '('

Hi @Sandeepani_Senevirathna,

It’s not explicitly stated in the docs but you need to specify a predicate too, that’s why you’re having an error. If you do not care about the predicate you can use TRUEPREDICATE for that.
Additionally argument substitution does not work with sort/limit clauses.

In your case your query would be:

list.Filter($"TRUEPREDICATE LIMIT ({offset}));

We will take care of upating the docs to make those two points explicit and hope this solve your doubts.