This is the update query I am operating. Error is here "set data =:updateValue", data is a reserved keyword from Dynamo DB. I think I should use update ExpressionAttributes here but not sure how to use for this case.
UpdateItemSpec updatetable = new UpdateItemSpec()
.withPrimaryKey("pId", jsonContext.read("$.pId"))
.withUpdateExpression("set data = :updateValue")
.withValueMap(new ValueMap().with(":updateValue", jsonpathCreatorLocation2));
locTable2.updateItem(updatetable);
final Map<String, String> expressions = new HashMap<>();
expressions.put("#d", "data");
UpdateItemSpec updatetable = new UpdateItemSpec()
.withPrimaryKey("pId", jsonContext.read("$.pId"))
.withUpdateExpression("set #d = :updateValue")
.withValueMap(new ValueMap().with(":updateValue", jsonpathCreatorLocation2));
.withExpressionAttributeNames(expressions);
locTable2.updateItem(updatetable);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.