You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, I want to update user status from "blocked" to "active". Instead of passing the whole details of user I want to do something like
` Table table = dynamoDB.getTable(tableName);
try {
UpdateItemSpec updateItemSpec = new UpdateItemSpec().withPrimaryKey("Id", 121)
.withUpdateExpression("set #status = :val1").withNameMap(new NameMap().with("#status", "NewAttribute"))
.withValueMap(new ValueMap().withString(":val1", "active")).withReturnValues(ReturnValue.ALL_NEW);
UpdateItemOutcome outcome = table.updateItem(updateItemSpec);
}
catch (Exception e) {
System.err.println("Failed to add new attribute in " + tableName);
System.err.println(e.getMessage());
}`
Regards,
Gail
The text was updated successfully, but these errors were encountered:
Hi, I am learning spring and dynamoDB. I'd like to know how can I update specific attribute of a record using spring-data-dynamodb? Just like the example in https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/JavaDocumentAPICRUDExample.html ?
For example, I want to update user status from "blocked" to "active". Instead of passing the whole details of user I want to do something like
` Table table = dynamoDB.getTable(tableName);
Regards,
Gail
The text was updated successfully, but these errors were encountered: