-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
DynamoDBMapper not supporting new Condition Expressions? #534
Comments
You can use Condition Operator together with Expected as a replacement of Condition Expression. We'll consider adding Condition Expression in the future release if more customers have the same requirement. |
I am also running into this inconsistency. I am new to DynamoDB and this took some digging to sus out. I wish to use the < and > operators to make a conditional save via the mapper. The SaveExpression class should support the non-deprecated parameters. http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html Thanks, |
Hello Jake, The reason we are not supporting this feature is because it is not as simple as supporting the Expected Map + Condition Operator. When you enable versioning or auto generatinging keys, we'll merge the conditions user provided with an internal conditions which is currently implemented using Expected Map. It is easy to merge conditions using the less powerful Expected Map, however merging the Condition Expression is not unless we write an expression parser. So we currently are not planning to support this feature until we have a better reason. Take a look at the onVersionAttribute() and onAutoGenerateAssignableKey() methods and you will have a better understanding. Sorry for the inconvenient. |
Hi again, Thanks for your response. This seems inconsistent to me, because this works on the delete operation: http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBDeleteExpression.html My use case is similar for save and delete. I have stored date strings and want to only update or delete a record if a given date is newer than the stored date. I can do this with the delete API. Without this feature I do not think I can do it with the save API. Without digging into the details of the feature you linked, I somewhat understand this might be difficult to implement alongside another feature. I am not sure what sort of case will meet the bar to get this done, though--I am providing what seems to be a valid use case. Perhaps you can simply raise an UnsupportedOperationException if end users try to use both features combined. Am I limited at this point to making a load call to check the value before using save? The concurrency might be good enough for my use case, but I would prefer the strong consistency of the single operation. Thanks again, |
Please implement this. The fact that it's a |
Same here. And as the |
Hey @derjust @jakeab @ryonday @agudian, the SDK team has reviewed the feature request list for V1, and since they're concentrating efforts on V2 new features they decided to not implement this one in V1. It's still being considered for the DynamoDB Mapper refactor in V2, see the referenced issue above. I'll go ahead and close this one. Please feel free to comment on the V2 issue with your use case, and reach out if you have further questions. |
Hi AWS!
I'm using DynamoDB via the
DynamoDBMapper
throughout our application.Recently I wanted to add a Condition Expression to a
PUT
operation - looks likeDynamoDBSaveExpression
only supports the old/deprecatedExpected
style?Or is there another class to be used?
Wondering mostly because the new Condition Expression seem to exist on
DynamoDBDeleteExpression
?!The text was updated successfully, but these errors were encountered: