private function getResultsInRange(PagerInterface $pager, array $query_params): array
    {
        $query_params['startKey'] = $pager->getStartKey();
        // Do not add 0 unnecessarily to the query parameters.
        if ($pager->getLimit() > 0) {
            $query_params['count'] = $pager->getLimit();
        }
        $uri = $this->getBaseEndpointUri()->withQuery(http_build_query($query_params));
        $response = $this->getClient()->get($uri);

        return $this->responseToArray($response);
    }