使用 DynamoDBItemRequest 提取“firstName”对象,我得到的是:
{S: Will,N: (null),B: (null),SS: ( ),NS: ( ),BS: ( ),}
我尝试提取第一个对象,但它一直给我一个错误。经过一番挖掘,我意识到 DynamoDB 不返回 NSString 或 NSArray 对象。任何人有任何运气提取数据集?这是我的代码 -
-(void)tap
{
DynamoDBGetItemRequest *getItemRequest = [[DynamoDBGetItemRequest new] autorelease];
DynamoDBAttributeValue *attributeValue = [[[DynamoDBAttributeValue alloc] initWithN:[NSString stringWithFormat:@"%d", 1]] autorelease];
getItemRequest.tableName = TEST_TABLE_NAME;
getItemRequest.key = [NSMutableDictionary dictionaryWithObject:attributeValue forKey:TEST_TABLE_HASH_KEY];
DynamoDBGetItemResponse *getItemResponse = [[AmazonClientManager ddb] getItem:getItemRequest];
NSMutableDictionary *userPreferences = getItemResponse.item;
NSArray *abc = [userPreferences objectForKey:@"lastName"];
NSLog(@"%@", abc);
}
这是我对不断给我错误的代码的尝试->
// NSString *abb = abc[1];
// NSLog(@"%@", abb);