How to use LastEvaluatedKey in ExecuteStatement request?

0

According to the documentation for ExecuteStatement:

If LastEvaluatedKey is present in the response, you need to paginate the result set.

How can I use LastEvaluatedKey if ExecuteStatement request has no ExclusiveStartKey parameter as Scan and Query.

I cannot use NextToken because it is not returned when Limit is specified.

質問済み 2年前1204ビュー
1回答
2
承認された回答

This is something the team are currently working on. When you use Limit you are not returned a NextToken, but a LastEvaluatedKey, and due to the lack of ExclusiveStartKey it cannot be used for Pagination. Unfortunately I do not have an ETA on the fix, but it is being worked on priority.

For now, if you are using Query you can alter your request to add the SK of the LastEvaluatedKey:

SELECT * FROM mytable WHERE PK='x' AND SK > {SK returned in LEK}

Hope that helps

profile pictureAWS
エキスパート
回答済み 2年前
  • @Leeroy,

    Also running into this issue with first ExecuteStatement. But I do get a "NextToken" returned but when we fed it into the next "ExecuteStatement" as part of input, we keep getting an error "NextToken does not match request".

    1. Is this the same issue quoted?
    2. if so, do we have any estimated timeline?

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ