Database Reference
In-Depth Information
[productIdCondition addAttributeValueList:productId];
[conditions setObject: productIdCondition
forKey:@"productId"];
// Specify the key conditions , here product id = 123
DynamoDBCondition *lastModifiedCondition =
[DynamoDBCondition new];
lastModifiedCondition.comparisonOperator = @"EQ";
DynamoDBAttributeValue *userName = [[DynamoDBAttributeValue
alloc] initWithS:@"Alice"];
[lastModifiedCondition addAttributeValueList:userName];
[conditions setObject:lastModifiedCondition
forKey:@"lastModifiedBy"];
NSMutableDictionary *queryStartKey = nil;
do {
DynamoDBQueryRequest *queryRequest =
[DynamoDBQueryRequest new];
queryRequest.tableName = @"ProductTable";
queryRequest.exclusiveStartKey = queryStartKey;
// specify the local secondary index
queryRequest.keyConditions = conditions;
queryRequest.indexName = @"lastModifiedBy-index";
// Invoke query
DynamoDBQueryResponse *queryResponse = [[Constants ddb]
query:queryRequest];
// Use query results
..
// check if there are more records for the query
queryStartKey = queryResponse.lastEvaluatedKey;
} while ([queryStartKey count] != 0);
Search WWH ::




Custom Search