如何使用 python (boto3) 从 DynamoDB 中删除所有项目?
我正在尝试这样做:
scan = table.scan()
with table.batch_writer() as batch:
for each in scan['Items']:
batch.delete_item(Key=each)
但是给我这个错误:
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the BatchWriteItem operation: The provided key element does not match the schema
原文由 Dansp 发布,翻译遵循 CC BY-SA 4.0 许可协议
我找到了解决办法!我只是用我的表 Id 和搜索 Id (compId) 挂载密钥,它就起作用了:)