code: public int count(Class<?> clazz, DynamoDBQueryExpression queryExpression, DynamoDBMapperConfig config) {
          config = mergeConfig(config);
  
          QueryRequest queryRequest = createQueryRequestFromExpression(clazz, queryExpression, config);
          queryRequest.setCount(true);
  
          // Count queries can also be truncated for large datasets
          int count = 0;
          QueryResult queryResult = null;
          do {
              queryResult = db.query(applyUserAgent(queryRequest));
              count += queryResult.getCount();
              queryRequest.setExclusiveStartKey(queryResult.getLastEvaluatedKey());
          } while (queryResult.getLastEvaluatedKey() != null);
  
          return count;
      }
docs: Evaluates the specified query expression and returns the count of
  matching items, without returning any of the actual item data.
  
  @param clazz
  The class mapped to a DynamoDB table.
  @param queryExpression
  The parameters for running the scan.
  @param config
  The mapper configuration to use for the query, which overrides
  the default provided at object construction.
  @return The count of matching items, without returning any of the actual
  item data.