Skip to content

Commit

Permalink
filter out non-necessary attrs on PUT()
Browse files Browse the repository at this point in the history
  • Loading branch information
Yegor Bugayenko committed May 12, 2014
1 parent 976ba6a commit 268d5dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<version>1.6.1</version>
</parent>
<artifactId>jcabi-dynamo</artifactId>
<version>1.0-SNAPSHOT</version>
<version>0.14.1</version>
<packaging>jar</packaging>
<name>jcabi-dynamo</name>
<description>Object Oriented Wrapper of Amazon DynamoDB SDK</description>
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/jcabi/dynamo/AwsItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,12 @@ public Map<String, AttributeValue> put(
@NotNull(message = "attributes can't be NULL")
final Map<String, AttributeValueUpdate> attrs) {
final AmazonDynamoDB aws = this.credentials.aws();
final Attributes expected = this.attributes.only(this.keys);
try {
final UpdateItemRequest request = new UpdateItemRequest()
.withTableName(this.name)
.withExpected(this.attributes.asKeys())
.withKey(this.attributes)
.withExpected(expected.asKeys())
.withKey(expected)
.withAttributeUpdates(attrs)
.withReturnConsumedCapacity(ReturnConsumedCapacity.TOTAL)
.withReturnValues(ReturnValue.UPDATED_NEW);
Expand Down

0 comments on commit 268d5dd

Please sign in to comment.