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

Support NE condition operator #243

Merged
merged 1 commit into from Mar 13, 2018
Merged

Support NE condition operator #243

merged 1 commit into from Mar 13, 2018

Conversation

andrykonchin
Copy link
Member

@andrykonchin andrykonchin commented Mar 10, 2018

Now we can use ne operator in where conditions:

Document.where('age.ne' => 10).all

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

@coveralls
Copy link

coveralls commented Mar 10, 2018

Coverage Status

Coverage increased (+0.005%) to 97.542% when pulling a82e881 on add-ne-operator into 46b1784 on master.

3 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.005%) to 97.542% when pulling a82e881 on add-ne-operator into 46b1784 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.005%) to 97.542% when pulling a82e881 on add-ne-operator into 46b1784 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.005%) to 97.542% when pulling a82e881 on add-ne-operator into 46b1784 on master.

Copy link
Member

@pboling pboling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@pboling pboling merged commit 56a1da8 into master Mar 13, 2018
@pboling pboling deleted the add-ne-operator branch March 13, 2018 23:13
@pboling
Copy link
Member

pboling commented Mar 13, 2018

@andrykonchin We need to add the synopsis of all these changes into the CHANGELOG!

@mrkamel
Copy link
Contributor

mrkamel commented Oct 7, 2022

can this query be supported by indices?
i have a global secondary index on version, but dynamoid complains:

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
Copy link
Member Author

What request would you expect Dynamoid to perform in terms of Scan/Query operations?

@mrkamel
Copy link
Contributor

mrkamel commented Oct 9, 2022

@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.

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

Successfully merging this pull request may close these issues.

None yet

5 participants