I tried to fetch the records on behalf of year(reserved keyword) from dynamodb.
But could not get success.
DynamoDBScanExpression queryExpression = new DynamoDBScanExpression();
queryExpression.withFilterExpression("year = :year).withExpressionAttributeValues(valueMap);
result = dynamoDBTemplate.scan(ABC.class, queryExpression);
DynamoDBScanExpression queryExpression = new DynamoDBScanExpression();
Map<String, AttributeValue> valueMap = new HashMap<>();
valueMap.put(":year", new AttributeValue().withS(2016));
queryExpression.withFilterExpression("#y = :year).
.withExpressionAttributeValues(valueMap);
Map<String, String> expression = new HashMap<>();
expression.put("#y", "year");
queryExpression.withExpressionAttributeNames(expression);
solved my problem.
Map<String, String> rwnm = new HashMap();
rwnm.put("#a", "action");
QuerySpec querySpec = new QuerySpec();
querySpec.withFilterExpression("#a > :action");
querySpec.withNameMap(rwnm);
querySpec.withValueMap(new ValueMap().withString(":action", "LightsOn"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With