Comparing UTC Datetime in Amazon DynamoDB using MomentJs

I'm using the Scan function on DynamoDB to access last-hour records. I'm using "momentJs" to subtract one hour from the current time and then format it as per the value available in the database. The query is running fine and returning the records, but the count is incorrect. It should be more than 200, but the query returns only 20 or 25 records. Records in the database are growing gradually. So on the next refresh, it should be more than the last run.

In DynamoDB, the column's datatype is a string. Maybe this is the issue, but I can't change the datatype in the database.

Feel free to share your thoughts/questions.
Thanks

Looks like you'll have to paginate results.

For transactions:

  • TransactWriteItems is limited to 25 items per request
  • TransactReadItems is limited to 25 items per request

You should have pagination details in the query's return if that's the issue

1 Like

Here's an example of how cursor-based pagination can work from Retool's end to help with the above :slightly_smiling_face: