例如:
myTable
id field1
1人
id作为主键,field1作为全局辅助索引:
- AttributeName: id
KeyType: HASH
GlobalSecondaryIndexes:
- IndexName: Field1Index
KeySchema:
- AttributeName: field1
KeyType: HASH当我使用dynamodb.scan()或dynamodb.get({TableName: 'myTable', Key: {id: 1}})时可以找到这条记录,但是当我使用
ExpressionAttributeNames: {
'#field1': 'field1'
},
ExpressionAttributeValues: {
":field1": field1
},
KeyConditionExpression: "#field1 = :field1",
IndexName: "Field1Index",})当时,可以找到早期数据,但无法找到最近的数据。
我不知道这是否与myTable的数据量超过8000有关系,但我还是必须提前说,我必须补充说,这个表的数据总是通过批量上传写入数据表中。
目前,我怀疑这些数据似乎没有登记在二级索引中。数据表中有8 357项,二级索引中有7 599项。因此,可以确定二级索引中缺少的项无法查询。数据。
同时,我也尝试先删除问题数据,然后再尝试再添加问题,问题仍然无法解决。
有人知道原因是什么吗?
发布于 2022-09-19 13:01:36
它看起来是这样的,但是由于java版本问题https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.OnlineOps.ViolationDetection.html,可能会有各种各样的警告。
https://stackoverflow.com/questions/73767971
复制相似问题