【发布时间】:2022-01-21 21:35:05
【问题描述】:
我正在使用 Dynamodb 项目 - getItem API 从 DynamoDB 表中获取记录。但它返回Item 对象,我想从Item 对象中检索特定的属性值。我们如何在 Java 中做到这一点?我找不到参考资料。
Table table = dynamoDB.getTable(tableName);
Item item = table.getItem(hashKeyFieldName, hashKeyFieldValue);
该项目包含以下字段:
HashKey, TimeStamp, NumRetries
我想从上面的item 中获取具体的 NumRetries 值。这是可能的吗?类似int numRetries = item.get("NumRetries");?
【问题讨论】:
标签: java amazon-web-services amazon-dynamodb aws-sdk