DynamoDB:提供的过滤器参数计数不支持尝试的过滤器操作

时间:2013-03-27 18:03:55

标签: ios amazon-web-services amazon-dynamodb

我正在使用带有Amazon Web Services的iOS SDK

我正在尝试使用以下代码发出扫描请求:

DynamoDBScanRequest *request = [[DynamoDBScanRequest alloc] initWithTableName:self.tableName];
DynamoDBCondition *condition = [[DynamoDBCondition alloc] init];
[condition setComparisonOperator:@"GT"];
NSString *key = [[alertView textFieldAtIndex:0] text];    //Returns NSString @"00610"

[request setScanFilterValue:condition forKey:key];

DynamoDBScanResponse *response = [self.dbClient scan:request];

我收到此错误:

  

提供的过滤器参数计数

不支持尝试的过滤器操作

请有人帮忙解释发生了什么!!!!

1 个答案:

答案 0 :(得分:2)

条件要求条件名称的特定大小AttributeValueList基于条件的名称;此错误表示您尝试使用错误数量的attributeValues GT(大于)。大于需要1个属性值,因此可能提供0或2。

以下是其他条件,以及它们所需的属性值数量:

NOT_NULL     0  (exists)
NULL         0  (not exists)
EQ           1  (equal) 
NE           1  (not equal)
IN           1  (exact matches)
LE           1  (less than or equal to)
LT           1  (less than)
GE           1  (greater than or equal to)
GT           1  (greater than)
CONTAINS     1  (substring or value in a set)
NOT_CONTAINS 1  (absence of a substring or absence of a value in a set)
BEGINS_WITH  1  (a substring prefix)
BETWEEN      2  (between)
相关问题