I am trying to scan failed token counts from dynamodb database table without any indexes. It is returning 0 from the database. I doubt it is not scanning complete database. Below is my method and the dynamoDBClient
working condition one and it has connection details. I am posting here only the scan query part
public int getFailedAuthStatusCount() {
Map<String,String> expressionAttributesNames = new HashMap<>();
expressionAttributesNames.put("#status","auth_status");
Map<String, AttributeValue> expressionAttributeValues = new HashMap<String, AttributeValue>();
expressionAttributeValues.put(":val", new AttributeValue().withS("FAIL"));
ScanRequest scanRequest = new ScanRequest()
.withTableName("Token")
.withFilterExpression("#status = :val")
.withExpressionAttributeNames(expressionAttributesNames)
.withExpressionAttributeValues(expressionAttributeValues);
ScanResult scanResult = dynamoDBClient.scan(scanRequest); //client is working fine.
return scanResult.getCount();
}
Here is the response.
{Items: [],Count: 0,ScannedCount: 1456,LastEvaluatedKey: {GUID={S: 0c4b281e6f9290c0fb3bf13f28c88fd,}, VENDOR={S: DELL,}},}
what is wrong with my request?