Created
May 7, 2018 14:20
-
-
Save supun19/c12d83f68d78c5cfdd1eb321eb8a83aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Table table = dynamoDB.getTable("Table Name"); | |
Map<String, String> consultee = new HashMap<>(); | |
UpdateItemSpec updateItemSpec = new UpdateItemSpec().withPrimaryKey("eventId",eventId) | |
.withUpdateExpression("set #consultees = list_append(if_not_exists(consultees, :empty_consultees), :consultees) , #url = :url") | |
.withNameMap(new NameMap().with("#consultees", "consultees").with("#url","url")) | |
.withValueMap(new ValueMap().withList(":consultees", Arrays.asList(consultee)).withList(":empty_consultees", Arrays.asList()).withString(":url",url)).withReturnValues(ReturnValue.ALL_NEW); | |
UpdateItemOutcome outcome = table.updateItem(updateItemSpec); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment