Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7657573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:04:03+00:00 2026-05-31T13:04:03+00:00

Currently, the ItemCollection#query method in the Ruby AWS SDK returns the whole dataset. I

  • 0

Currently, the ItemCollection#query method in the Ruby AWS SDK returns the whole dataset. I looked into the Ruby AWS SDK source code for any possibility of pagination, but the option closest to pagination is :limit, no pagination. According to the Amazon’s DynamoDB API (the HTTP, not Ruby) documentation for Query operation suggests there COULD be pagination with the response key LastEvaluatedKey:

Primary key of the item where the query operation stopped, inclusive of the previous result set. Use this value to start a new operation excluding this value in the new request.
The LastEvaluatedKey is null when the entire query result set is complete (i.e. the operation processed the “last page”).

So I can do paging by adding the :limit option, and then doing the next query for a range value after my last Item, but then I have no idea what the total count is unless I do a full query.

Is there a better/easier way of achieving pagination?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:04:04+00:00Added an answer on May 31, 2026 at 1:04 pm

    Depending on your needs, building a complete pager will likely require two requests, see Query and Scan in Amazon DynamoDB, in particular Count and ScannedCount:

    The Amazon DynamoDB Scan and Query APIs use Count values for two
    distinct purposes.

    In a request, set the Count parameter to true if you want Amazon
    DynamoDB to provide the total number of items that match the scan
    filter or query condition, instead of a list of the matching items.

    In a response, Amazon DynamoDB returns a Count value for the number of
    matching items in a request. If the matching items for a scan filter
    or query condition is over 1MB, Count contains a partial count of the
    total number of items that match the request
    . To get the full count of
    items that match a request, use the LastEvaluatedKey in a subsequent
    request. Repeat the request until Amazon DynamoDB no longer returns a
    LastEvaluatedKey.

    [emphasis mine]

    That is, to avoid complicated logic initially you’ll likely want to query the number of matching items upfront and request specific pages on demand thereafter only.

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently my query is very heavy, the table (table A) I need to update
Currently I have the following Mapping in my Controller: @RequestMapping( value = /add.html, method
Currently I have in my code tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(addCompoundToLabel:)]; My code
Currently, I don't really have a good method of debugging JavaScript in Internet Explorer and
Currently I have a UITableView with its data source being an NSFetchedResultsController . The
Currently I have the following method, but it doesn't quite work... - (UITableViewCell *)tableView:(UITableView
Currently running this code to open Business Vision (an application written by someone else
Currently we use jQuery to add RIA goodness to our apps, but recently we
Currently I have a class that looks like this: public class MyClass : IMyClass
Currently the HashSet<T> constructor that allows you to define your equality comparison yourself is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.