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

prevent overwriting based on global secondary index #31

Closed
edupre opened this issue Sep 19, 2016 · 2 comments
Closed

prevent overwriting based on global secondary index #31

edupre opened this issue Sep 19, 2016 · 2 comments
Labels

Comments

@edupre
Copy link

edupre commented Sep 19, 2016

Hello,
My understanding is that {overwrite : false} prevents overwriting only based on the partition key.

When I create an object with a generated partition key (uuid), how can I prevent overwriting based on another attribute (for instance, an email address) ? Note that this attribute could be a global secondary index.

Thanks!

@clarkie
Copy link
Owner

clarkie commented Sep 30, 2016

Unfortunately this isn't realistic with DynamoDB. The best approach is to use the email address as the hashkey. This is the only way to guarantee uniqueness with dynamodb.

@clarkie
Copy link
Owner

clarkie commented Sep 30, 2016

For more information on conditional writes please see #32

@clarkie clarkie closed this as completed Sep 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants