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

Conditional put #41

Open
goozler opened this issue Oct 24, 2016 · 4 comments
Open

Conditional put #41

goozler opened this issue Oct 24, 2016 · 4 comments
Labels
feature-request A feature should be added or improved.

Comments

@goozler
Copy link

goozler commented Oct 24, 2016

Hi! Is there any way to do a conditional put request? The case when I get some data, change it by some operations and I want to save it back only if data in DynamoDB still the same when I get it.

Maybe you could give me an advice how to implement it with a few changes.

@awood45
Copy link
Member

awood45 commented Oct 24, 2016

#save doesn't yet expose this functionality, but i think it should. The tricky part is how we want to expose the condition expression. I'm going to chew on this a bit - one possible option that solves this generically is maybe an :override_parameters option that is passed in to save, that lets you override any of the underlying client parameters. In this manner, you could provide conditional expressions, or for that matter, alter any other underlying client option if you know what you're doing. It wouldn't preclude other params that do this in a higher level way either.

@awood45
Copy link
Member

awood45 commented Oct 25, 2016

Okay, after some discussions, I think the plan will be to expose select parameters individually (override parameters causes nasty collision issues with existing helper functionality).

For example, you could append to existing conditions, and the condition expression would look kind of like:

"#{aws_record_condition_expression} AND (#{user_provided_condition_expression})"

..and then we would merge the expression attribute name and value hashes.

@srgl srgl mentioned this issue Jan 18, 2017
@jmclachlan
Copy link

Any update on this?

@awood45
Copy link
Member

awood45 commented Dec 13, 2018

We're going to work this in with smart query/scan support that I'm working on.

@mullermp mullermp added the feature-request A feature should be added or improved. label Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

4 participants