-
Notifications
You must be signed in to change notification settings - Fork 22
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
Sort not working #34
Comments
Trying to work this out myself as well. Looks like the index is set around line 546: https://github.com/gadelkareem/sails-dynamodb/blob/master/index.js#L546
Regardless of this, the lines you posted don't make sense for the handling of the sort. It gets the first key in the sort dictionary and expects that to be
to sort that index in a descending way. I made #35 to see if that works |
You can use |
I made #36 for a documentation update to show how this feature works for this adapter |
When I sort by a -1, I am getting query.descending not a function defined on line 897. Any thoughts?
|
My thoughts are that you may not have an index on what you are searching by or ordering by so it's trying to do it in scan mode instead of query mode. |
Hi, I'm trying to sort by updatedAt but when I define an index to that attribute on model and lunch local dynamodb throws this error "Cannot read property 'dynamoType' of undefined". Is this a bug? |
Doesn't sound like a bug or this open issue. Sounds like a configuration issue. |
It seems that sort conditions are not taken into account.
In index.js in the Sort section you have this code:
It can't even work as sort equals the key and not the value.
Are there any plan to update this behaviour ?
The text was updated successfully, but these errors were encountered: