I have to update the dynamodb only if key is present and do not want to create a new row if key is not present.
My Syntax is:
PrimaryKey pk = new PrimaryKey("partitionKey", key1, "sortKey", key2);
String updateExpression = "set abc =:s";
String value = "xyz";
UpdateItemSpec updateItemSpec = new UpdateItemSpec()
.withPrimaryKey(pk)
.withUpdateExpression(updateExpression)
.withValueMap(new ValueMap().withString(":s", value))
.withConditionExpression(?);
table.updateItem(updateItemSpec);
What should I provide in withConditionExpression. How can I use attribute_exist() here?