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

Secondary Indexes? #43

Closed
runvnc opened this issue May 23, 2013 · 5 comments
Closed

Secondary Indexes? #43

runvnc opened this issue May 23, 2013 · 5 comments

Comments

@runvnc
Copy link

runvnc commented May 23, 2013

Hello, does this library support Secondary Indexes?

@alexbosworth
Copy link
Contributor

It doesn't - but I posted a method for the new style of query in #44

@runvnc
Copy link
Author

runvnc commented May 27, 2013

Awesome so to use that you would use query_DynamoDB_20120810 and specify keyConditions or something?
Question: how does node-dynamodb currently handle different api versions, or does it only support one version (except for your patch)?

@alexbosworth
Copy link
Contributor

I couldn't really find a good writeup anywhere by Amazon of what they changed exactly (other than the query method)

In my method I tried to make it backwards compatible so that it wouldn't break existing code. If you specify keyConditions in your query, it switches to the new query API, if you leave them out, it goes to the legacy query API

I didn't change any other methods, and if you don't specify keyConditions everything should be the same as the existing module.

@runvnc
Copy link
Author

runvnc commented May 27, 2013

I see now. Nice! So the tests all run fine then?

@runvnc runvnc closed this as completed May 27, 2013
@alexbosworth
Copy link
Contributor

Everything should be good but re issue #19 there didn't seem to be integration tests for querying

Theoretically though I just changed the basic syntax of the query and kept the same logic as the other query method

One tricky thing I noticed is that it's harder to cause a user error in the original query function. Now that the index restrictions are looser and you have to make sure you specify your hash and range keys by name and not just 'range key', 'hash key', you need to pay more attention to well formed queries than in the original function.

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