code: @View(name = "count_by_userId", map = "function(doc) { if(doc.token && doc.userId) { emit(doc.userId, doc) } }", reduce = "_count")
      public long countByUserId(final String userId) {
          val view = createQuery("count_by_userId").key(userId);
          val rows = db.queryView(view).getRows();
          if (rows.isEmpty()) {
              return 0;
          }
          return rows.get(0).getValueAsInt();
      }
docs: Token count for a user.
  
  @param userId user to count tokens for
  @return count of the user's tokens