ฉันได้ลองใช้ DynamoDB ครั้งแรกหลังจากใช้ฐานข้อมูลเชิงสัมพันธ์มาเป็นเวลานาน ขณะนี้กำลังดำเนินการอัปเดตผลการทดสอบสำหรับการวิเคราะห์ในภายหลัง โปรดพิจารณาตารางและดัชนีรองต่อไปนี้
ฉันพยายามรับชื่อทดสอบที่กำหนด การทดสอบทำงานในช่วงการแก้ไขที่ทราบโดยใช้โค้ด Java ต่อไปนี้:
HashMap<String, Condition> scanMap = new HashMap<>();
scanMap.put("revision", new Condition().withComparisonOperator(ComparisonOperator.BETWEEN).withAttributeValueList(Arrays.asList(new AttributeValue("N:"+String.valueOf(minRev)), new AttributeValue("N:"+String.valueOf(maxRev)))));
scanMap.put("testName", new Condition().withComparisonOperator(ComparisonOperator.EQ).withAttributeValueList(new AttributeValue(Collections.singletonList(testName))));
DynamoDBScanExpression scanExpression = new DynamoDBScanExpression().withScanFilter(scanMap);
scanExpression.setIndexName("testName-revision-index");
List<ValidationReport> reports = getMapper().scan(ValidationReport.class, scanExpression);
ฉันพยายามลบ "N:" โดยไม่มีโชค การลบนิพจน์การแก้ไขทั้งหมดจะส่งคืนการทดสอบทั้งหมดโดยไม่มีข้อจำกัดเกี่ยวกับช่วงการแก้ไข
ความช่วยเหลือใด ๆ ที่จะได้รับการชื่นชมที่นี่