[英]How to update a value for reserved keyword in Dynamo DB. Error: Attribute name is a reserved keyword; reserved keyword: data
這是我正在操作的更新查詢。 此處出現錯誤“set data =:updateValue”,data 是 Dynamo DB 的保留關鍵字。 我想我應該在這里使用更新 ExpressionAttributes 但不確定如何在這種情況下使用。
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);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.