Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize orderBy when ordering is desc #634

Open
hgrubst opened this issue Sep 19, 2017 · 1 comment
Open

Optimize orderBy when ordering is desc #634

hgrubst opened this issue Sep 19, 2017 · 1 comment

Comments

@hgrubst
Copy link

hgrubst commented Sep 19, 2017

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 ?

@jojo-tutor
Copy link

Same issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants