code: private function runQuery(array $query, int $limit): Result
      {
          $query['Limit']  = $limit + 1;
          $result          = $this->dynamoDbClient->query($query);
          $result['Items'] = array_slice($result['Items'], 0, $limit);
  
          return $result;
      }
docs: Runs the DynamoDB query with limit + 1
  and removes the last item from result if item count exceeds page limit
  
  @param array $query
  @param int   $limit
  
  @return Result