Database Reference
In-Depth Information
Map<String, AttributeValue> lastEvaluatedKey = null;
do {
QueryRequest qryRequest = new QueryRequest()
.withTableName("Book")
.withKeyConditions(conditions)
.withLimit(20)
.withExclusiveStartKey(lastEvaluatedKey);
QueryResult result =
dynamoDBClient.query(qryRequest);
for (Map<String, AttributeValue> resItem :
result.getItems()) {
System.out.println(resItem);
}
lastEvaluatedKey = result.getLastEvaluatedKey();
} while (lastEvaluatedKey != null);
}
The previous code snippet would fetch the topic query results in 20 records per cycle.
Using the AWS SDK for .NET
Similar to Java, we need to create a query request in .NET and invoke a query method
from the DynamoDB client using the following code:
var request = new QueryRequest
{
TableName = "Book",
KeyConditions = new Dictionary<string,Condition>()
{
{
"yop",
new Condition()
{
ComparisonOperator = "EQ",
AttributeValueList = new List<AttributeValue>()
{
new AttributeValue { N = 2014 }
}
}
Search WWH ::




Custom Search