【发布时间】:2020-11-19 19:39:21
【问题描述】:
我正在使用带有 dynamodb 的 nodejs。我需要在我的代码中添加 TTL 功能。当我在我的架构文件中添加以下代码并尝试创建表时,它会给出以下错误。此外,我的 timetolive 字段也没有在桌子上创建。
{
AttributeDefinitions: [
{ AttributeName: 'foo', AttributeType: 'S' },
{ AttributeName: 'baar', AttributeType: 'N' },
{ AttributeName: 'timetolive', AttributeType: 'N' }
],
KeySchema: [
{ AttributeName: 'foo', KeyType: 'HASH' },
{ AttributeName: 'baar', KeyType: 'RANGE' }
],
ProvisionedThroughput: { ReadCapacityUnits: 1, WriteCapacityUnits: 1 },
TimeToLiveSpecification: { AttributeName: 'timetolive', Enabled: true },
TableName: 'mytablename'
}
错误:
UnexpectedParameter: Unexpected key 'TimeToLiveSpecification' found in params
【问题讨论】:
标签: amazon-web-services amazon-dynamodb schema ttl