public function chunk($chunkSize, callable $callback)
    {
        while (true) {
            $results = $this->getAll([], $chunkSize, false);

            if (!$results->isEmpty()) {
                if (call_user_func($callback, $results) === false) {
                    return false;
                }
            }

            if (empty($this->lastEvaluatedKey)) {
                break;
            }
        }

        return true;
    }