【发布时间】:2017-09-21 16:07:40
【问题描述】:
我正在尝试删除带有条件的记录,但失败了。我不断收到此错误:The provided key element does not match the schema。
这是我在 yml 中的定义:
resources:
Resources:
vuelosTable:
Type: 'AWS::DynamoDB::Table'
DeletionPolicy: Delete
Properties:
AttributeDefinitions:
-
AttributeName: id
AttributeType: S
-
AttributeName: vuelta
AttributeType: S
KeySchema:
-
AttributeName: id
KeyType: HASH
-
AttributeName: vuelta
KeyType: RANGE
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: ${self:provider.environment.DYNAMODB_TABLE}
这些是尝试删除时的参数:
params = {
RequestItems: {
[process.env.DYNAMODB_TABLE]: [{
DeleteRequest: {
Key: {
"vuelta": "2017-09-09"
}
}
}]
}
};
我知道这是我没有得到的东西,但我不知道是什么。有什么想法吗?
【问题讨论】:
标签: node.js amazon-dynamodb serverless-framework