我想获得许多 videoIds 的项目,而不是像这段代码中只有一个视频项目?有没有办法从索引中查询多个项目?
AWSDynamoDBObjectMapper *objectMapper = [AWSDynamoDBObjectMapper defaultDynamoDBObjectMapper];
AWSDynamoDBQueryExpression *queryExpression = [AWSDynamoDBQueryExpression new];
queryExpression.indexName = @"getVideoItem";
queryExpression.keyConditionExpression = @"#id = :id";
queryExpression.expressionAttributeNames = @{
@"#id" : @"id",
};
queryExpression.expressionAttributeValues = @{
@":id" : videoId,
};
__weak typeof(self) weakSelf = self;
[objectMapper query:[PublicVideos class]
expression:queryExpression
completionHandler:^(AWSDynamoDBPaginatedOutput * _Nullable response, NSError * _Nullable error) {
if (!error) {
dispatch_async(dispatch_get_main_queue(), ^{
if ([weakSelf.delegate respondsToSelector:@selector(ServerConnectionHandlerVideoListRecevied:)]) {
[weakSelf.delegate ServerConnectionHandlerVideoListRecevied:response.items];
}
});
}
}];