Database Reference
In-Depth Information
// If the response lastEvaluatedKey has contents, that
means there are more // results
lastEvaluatedKey = queryResult.getLastEvaluatedKey();
} while (lastEvaluatedKey != null);
iOS
Here is the syntax to fetch data from a given DynamoDB table using a query API:
// specify the query condition, here product id = 123
DynamoDBCondition *condition = [DynamoDBCondition new];
condition.comparisonOperator = @"EQ";
DynamoDBAttributeValue *productId =
[[DynamoDBAttributeValue alloc] initWithN:@"123"];
[condition addAttributeValueList:productId];
NSMutableDictionary *queryStartKey = nil;
do {
DynamoDBQueryRequest *queryRequest =
[DynamoDBQueryRequest new];
queryRequest.tableName = @"ProductTable";
queryRequest.exclusiveStartKey = queryStartKey;
queryRequest.keyConditions = [NSMutableDictionary
dictionaryWithObject:condition forKey:@"productId"];
DynamoDBQueryResponse *queryResponse = [[Constants ddb]
query:queryRequest];
// Each item in the result set is a NSDictionary of
DynamoDBAttributeValue
for (NSDictionary *item in queryResponse.items) {
DynamoDBAttributeValue *recordId = [item
objectForKey:@"recordId"];
Search WWH ::




Custom Search