diff --git a/CHANGELOG.md b/CHANGELOG.md index a370d43..90248b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Changed + +- fix pagination when next token is an array + ## 3.3.0 ### Added diff --git a/src/Result/BatchGetItemOutput.php b/src/Result/BatchGetItemOutput.php index 11237a3..ed57f41 100644 --- a/src/Result/BatchGetItemOutput.php +++ b/src/Result/BatchGetItemOutput.php @@ -83,7 +83,7 @@ public function getConsumedCapacity(bool $currentPageOnly = false): iterable $page = $this; while (true) { $page->initialize(); - if (null !== $page->unprocessedKeys) { + if ([] !== $page->unprocessedKeys) { $input->setRequestItems($page->unprocessedKeys); $this->registerPrefetch($nextPage = $client->batchGetItem($input)); diff --git a/src/Result/QueryOutput.php b/src/Result/QueryOutput.php index 449e03d..0b0a069 100644 --- a/src/Result/QueryOutput.php +++ b/src/Result/QueryOutput.php @@ -116,7 +116,7 @@ public function getItems(bool $currentPageOnly = false): iterable $page = $this; while (true) { $page->initialize(); - if (null !== $page->lastEvaluatedKey) { + if ([] !== $page->lastEvaluatedKey) { $input->setExclusiveStartKey($page->lastEvaluatedKey); $this->registerPrefetch($nextPage = $client->query($input)); diff --git a/src/Result/ScanOutput.php b/src/Result/ScanOutput.php index 85d2ca3..90ce249 100644 --- a/src/Result/ScanOutput.php +++ b/src/Result/ScanOutput.php @@ -116,7 +116,7 @@ public function getItems(bool $currentPageOnly = false): iterable $page = $this; while (true) { $page->initialize(); - if (null !== $page->lastEvaluatedKey) { + if ([] !== $page->lastEvaluatedKey) { $input->setExclusiveStartKey($page->lastEvaluatedKey); $this->registerPrefetch($nextPage = $client->scan($input));