DynamoDB现在是区分大小写的,正如您在这个线程中看到的那样。
我的老板让我制作一个不识别大写字母和小写字母的过滤器,我添加了以下代码,该代码制作了过滤器,但识别了大写字母和大写字母的使用,并且找不到任何
DynamoDBMapper mapper = new DynamoDBMapper(amazonDynamoDB);
DynamoDBScanExpression scanExpression = new DynamoDBScanExpression();
Map<String, AttributeValue> eav = new HashMap<String, AttributeValue>();
Map<String, String> ean = new HashMap<String, String>();
StringJoiner where = new StringJoiner(" and ");
if (status != null) {
eav.put(":status", new AttributeValue().withS(status));
where.add("#status = :status");
ean.put("#status", "status");
scanExpression.withExpressionAttributeNames(ean);
}
if (where.length() > 0) {
scanExpression.withFilterExpression(where.toString()).withExpressionAttributeValues(eav).withConsistentRead(false);
}
// Scan to the end of the page after the requested page
int scanTo = (int) (pageable.getOffset() + (2 * pageable.getPageSize()));
进行此搜索的另一种方法是用大写/小写保存另一个字段,然后将搜索更改为此字段。