How to Do Type casting in Couchbaselite SDK


#1

Hi Support,

I am having a field named “Number” as string in my documents. While querying using iOS SDK I have to user orderBy property. Since number is saved as string So orderBy(Ordering.property(“number”).descending()) is treating it as string. Is there any way to typecast any property to Int in query?

Thanks


#2

Save the field as a number, not a string.