Lädt...


🔧 [20 Days of DynamoDB] Day 11 - Using pagination with Query API


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

Posted: 22/Jan/2024

The Query API returns the result set size to 1 MB. Use ExclusiveStartKey and LastEvaluatedKey elements to paginate over large result sets. You can also reduce page size by limiting the number of items in the result set, with the Limit parameter of the Query operation.

Here is an example:

func paginatedQuery(searchCriteria string, pageSize int32) {

    currPage := 1
    var exclusiveStartKey map[string]types.AttributeValue

    for {
        resp, _ := client.Query(context.Background(), &dynamodb.QueryInput{
            TableName:              aws.String(tableName),
            KeyConditionExpression: aws.String("ForumName = :name"),
            ExpressionAttributeValues: map[string]types.AttributeValue{
                ":name": &types.AttributeValueMemberS{Value: searchCriteria},
            },
            Limit:             aws.Int32(pageSize),
            ExclusiveStartKey: exclusiveStartKey,
        })

        if resp.LastEvaluatedKey == nil {
            return
        }
        currPage++
        exclusiveStartKey = resp.LastEvaluatedKey
    }
}

Recommended reading - Query Pagination

...

🔧 [20 Days of DynamoDB] Day 17 - DynamoDB BatchGetItem operation


📈 47.05 Punkte
🔧 Programmierung

🔧 Unleashing MongoDB: Why Cursor-Based Pagination Outperforms Offset-Based Pagination Every Time!


📈 38.98 Punkte
🔧 Programmierung

🐧 DynamoDB Pagination: Overview, Use Cases, and Examples


📈 36.66 Punkte
🐧 Linux Tipps

🔧 [20 Days of DynamoDB] Day 7 - DeleteItem API


📈 35.65 Punkte
🔧 Programmierung

🔧 DynamoDB Transactions: An E-Commerce with Amazon DynamoDB


📈 34.35 Punkte
🔧 Programmierung

🔧 DynamoDB Basic - Part 1: Introduction DynamoDB


📈 34.35 Punkte
🔧 Programmierung

🔧 CodeSOD: Query Query Query


📈 31.92 Punkte
🔧 Programmierung

🔧 Learning AWS Day by Day — Day 48 — Amazon DynamoDB — Part 4


📈 30.75 Punkte
🔧 Programmierung

🔧 Learning AWS Day by Day — Day 47 — Amazon DynamoDB — Part 3


📈 30.75 Punkte
🔧 Programmierung

🔧 Learning AWS Day by Day - Day 46 - Amazon DynamoDB - Part 2


📈 30.75 Punkte
🔧 Programmierung

🔧 Learning AWS Day by Day — Day 45 — Amazon DynamoDB — Part 1


📈 30.75 Punkte
🔧 Programmierung

🔧 [20 Days of DynamoDB] Day 8 - Conditional Delete operation


📈 29.88 Punkte
🔧 Programmierung

🔧 [20 Days of DynamoDB] Day 6 - Atomic counters with UpdateItem


📈 29.88 Punkte
🔧 Programmierung

🔧 [20 Days of DynamoDB] Day 4 - Conditional UpdateItem


📈 29.88 Punkte
🔧 Programmierung

🔧 [20 Days of DynamoDB] Day 3 - UpdateItem add-on benefits


📈 29.88 Punkte
🔧 Programmierung

🔧 [20 Days of DynamoDB] Day 2 - GetItem add-on benefits


📈 29.88 Punkte
🔧 Programmierung

🔧 [20 Days of DynamoDB] Day 19 - PartiQL Batch Operations


📈 29.88 Punkte
🔧 Programmierung

🔧 DynamoDB Query Evaluation Order Differs from SQL


📈 27.81 Punkte
🔧 Programmierung

🐧 DynamoDB Query Examples


📈 27.81 Punkte
🐧 Linux Tipps

🔧 20 Days of DynamoDB


📈 25.36 Punkte
🔧 Programmierung

🔧 20 Days of DynamoDB


📈 25.36 Punkte
🔧 Programmierung

🔧 Answer: Shopify GraphQL API Pagination Stuck in Infinite Loop with Same `endCursor`


📈 25.26 Punkte
🔧 Programmierung

🔧 Shopify GraphQL API Pagination Stuck in Infinite Loop with Same `endCursor`


📈 25.26 Punkte
🔧 Programmierung

🔧 Customizing API Resource Pagination Structure


📈 25.26 Punkte
🔧 Programmierung

🔧 Improve Your Web API Performance With Pagination


📈 25.26 Punkte
🔧 Programmierung

🔧 Day 21. Pagination


📈 24.02 Punkte
🔧 Programmierung

🔧 Comment system: API Gateway & DynamoDB Integration in Pulumi


📈 22.95 Punkte
🔧 Programmierung

🔧 Deploying a serverless web application on S3, API gateway, lambda, DynamoDB


📈 22.95 Punkte
🔧 Programmierung

🔧 Deploy Your First Web App on AWS with AWS Amplify, Lambda, DynamoDB and API Gateway


📈 22.95 Punkte
🔧 Programmierung

🔧 API Gateway, Lambda, DynamoDB and Rust


📈 22.95 Punkte
🔧 Programmierung

matomo