4

我正在使用带有 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];

我收到此错误:

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

求大神帮忙解释一下是怎么回事!!!!

4

1 回答 1

2

AttributeValueList条件需要根据条件名称为条件名称指定特定大小;此错误意味着您尝试使用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)
于 2013-03-30T00:33:45.560 回答