Currently orderBy in thinky optimizes the query if an index is found on the Model.
As described in the documenation :
The command orderBy is optimized only when a string is passed as the first argument.
Unfortunately if you need to orderBy desc, this does not work as you need to pass your query in the form :
User.orderBy(r.desc('lastName')) which is then not passing a string anymore.
Is there a workaround for this ? Or would it be possible to have thinky overload the orderBy method say by adding a 2nd parameter (boolean) as the order of the sort ?
Currently orderBy in thinky optimizes the query if an index is found on the Model. As described in the documenation :
Unfortunately if you need to orderBy desc, this does not work as you need to pass your query in the form :
User.orderBy(r.desc('lastName'))
which is then not passing a string anymore.Is there a workaround for this ? Or would it be possible to have thinky overload the orderBy method say by adding a 2nd parameter (boolean) as the order of the sort ?