2016-06-01 65 views
6

我正在使用DynamoDb作为我的一个应用程序。DynamoDb范围键可以为空吗?

我想知道是否有可能将某个属性设置为范围键,然后将其保留为未填充某些记录(空或空)。

回答

10

您不能使用Range键作为空值或不使用Range键插入项目。

如果不包含范围键。如果范围键填充 ''(即空字符串)

"message": "One or more parameter values were invalid: An AttributeValue may not contain an empty string" 

从AWS文件

"One of the required keys was not given a value" 

: - - :

When you add an item, the primary key attribute(s) are the only required attributes. Attribute values cannot be null. String and Binary type attributes must have lengths greater than zero. Set type attributes cannot be empty. Requests with empty values will be rejected with a ValidationException exception.

+0

HTTP:/你会得到下面的错误/docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html –

相关问题