JP Erasmus
03/02/2023, 8:58 PMint32
field that we want to be queryable (using query_by
), but also to sort_by
. For it to be queryable, we have to set the field's type to string
in the schema, but sorting on it produces the wrong results. Since these values are now strings instead of numbers if we sort them ascending, we get results for 1
, 10
, 100
, 2
, 20
, etc instead of 1
, 2
, 3
, etc.
Is there a way to do a type cast or transformation on the field when sorting? Something like sort_by: parseInt32(theField):asc
Jason Bosco
03/02/2023, 9:00 PMJP Erasmus
03/02/2023, 9:02 PM