【发布时间】:2016-06-10 20:25:07
【问题描述】:
查询结果以列表的形式出现
Map<String, AttributeValue>,
将单个 Map<String, AttributeValue> 转换为 JSON
我发现的唯一方法是遍历地图中的每个键,
并构建 JSON 字符串。
final ObjectNode node = JsonNodeFactory.instance.objectNode();
for (final Entry<String, AttributeValue> entry : item.entrySet()) {
node.put(entry.getKey(), getJsonNode(entry.getValue(), depth + 1));
}
有没有更有效的方法来实现这一点?有没有办法从 dynamoDB 获取 JSON 格式的结果。
【问题讨论】:
标签: json amazon-web-services jackson amazon-dynamodb