Couchbase Lite query to_number

I have the following QueryBuilder criteria.

.and(Expression.property("reportNumber").lessThanOrEqualTo

Property: reportNumber stores numeric values as string in the document.

Is there a way to apply to_number() function to reportNumber so that the comparison occurs between 2 numeric values?

In N1QL this is possible > and(x("to_number(reportNumber)") . Looking for the same thing in QueryBuilder .

Sorry you are out of luck for that one. It’s not wired up into the public API. We’ve had a similar tracking ticket for a while but it has not been prioritized -> https://issues.couchbase.com/browse/CBL-195

Hi Jim,

Can we use the workaround > (x + 0) will convert x to a number ??

Thanks