amazon-web-services - 范围键项目计数为 0 的 DynamoDB GSI

标签 amazon-web-services key amazon-dynamodb

我在 DynamoDB 中有一个表,如下所示:

enter image description here

我在表中添加了一个关于“类别”的全局二级索引,它工作正常,并在项目计数下给了我表中的项目数。

然后我意识到我实际上需要能够在特定的“类别”中搜索但按“UserRating”排序

所以我删除了 GSI 并创建了一个新的,如下所示:

enter image description here

我认为这一切都很好,正确类型(字符串)的类别和用户评级的(数字)的名称是正确的。

但是在它完成创建 GSI 后,我查看了控制台,它显示项目计数为 0,即使此测试表中应该有 13,如下图所示:

enter image description here

谢谢你的帮助。

最佳答案

根据 Amazon documentation这大约每 6 小时更新一次。

ItemCount - The number of items in the global secondary index. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.



就我而言,即使控制台仍然显示 ItemCount零并且没有返回索引的扫描/查询结果,我能够从我的代码中成功查询它。

关于amazon-web-services - 范围键项目计数为 0 的 DynamoDB GSI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37358777/

相关文章:

ruby - 游戏关键事件: Event or Method Overload?

dart - 通过在Dart中添加2个对象键,是否有更好的方法来创建对象?

java - DynamoDB 查询两个范围,然后排序

amazon-web-services - 如何使用多个索引查询 AWS DynamoDB?

amazon-web-services - AWS CLI : Error parsing parameter '--item' : Expected: '=' , 收到: '"' 用于输入:

python - 使用内部类输入类型调用 AWS lambda 函数

amazon-web-services - 尝试通过 Cloudfront 在 EC2 实例上设置 SSL 时出现 502 错误

amazon-web-services - docker 不创建文件

amazon-web-services - AWS 相当于 Azure 逻辑应用

JavaScript:深度检查对象具有相同的键