@Override
    public long count() {
        val query = new Query();
        query.addCriteria(Criteria.where("userId").exists(true));
        return this.mongoTemplate.count(query, GoogleAuthenticatorToken.class, this.collectionName);
    }
This is {@link GoogleAuthenticatorMongoDbTokenRepository}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-gauth-mongo/src/main/java/org/apereo/cas/gauth/token/GoogleAuthenticatorMongoDbTokenRepository.java