如何仅使用主键查询/扫描 DynamoDB 表?我能够从表中返回结果的唯一方法是下面的代码,我在其中设置了主键Id并Condition使用排序键添加了 a Date。
有什么方法可以在不提供 的情况下查询表RangeKeyCondition?
DynamoDataObject data = new DynamoDataObject();
data.setId(userId);
Condition rangeKeyCondition = new Condition()
.withComparisonOperator(ComparisonOperator.BEGINS_WITH)
.withAttributeValueList(new AttributeValue().withS("2018"));
DynamoDBQueryExpression queryExpression = new DynamoDBQueryExpression()
.withHashKeyValues(data)
.withRangeKeyCondition("Date", rangeKeyCondition)
.withConsistentRead(false);
PaginatedList<DynamoDataObject > result = AWSProvider.getInstance().getDynamoDBMapper().query(DynamoDataObject.class, queryExpression);
Log.d(TAG, "PaginatedList length: " + result.size());
qq_遁去的一_1
相关分类