-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Support NE
condition operator
#243
Conversation
3 similar comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
@andrykonchin We need to add the synopsis of all these changes into the CHANGELOG! |
can this query be supported by indices? pry> Recommendation.where('version.ne': '8a76c71b52b928ed12f5268ed8291d0b').first
Queries without an index are forced to use scan and are generally much slower than indexed queries!
You can index this query by adding index declaration to recommendation.rb:
* global_secondary_index hash_key: 'some-name', range_key: 'some-another-name'
* local_secondary_index range_key: 'some-name'
Not indexed attributes: :version.ne |
@andrykonchin yeah, ok, it seems there is no dynamo query which uses the key together with a NE operation. I was just wondering about the message "Not indexed attributes 'version.ne'" and thought there'd be something wrong. But i see, thx. |
Now we can use
ne
operator in where conditions:Be aware it doesn't work for sort key in QUERY operation (when there is some condition on partition key)
https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Condition.html
Related issue #241