@Override
    public OneTimeTokenAccount get(final String username, final long id) {
        val query = new Query();
        query.addCriteria(Criteria.where("username").is(username.trim()).and("id").is(id))
            .collation(Collation.of(Locale.ENGLISH).strength(Collation.ComparisonLevel.primary()));
        val r = this.mongoTemplate.findOne(query, GoogleAuthenticatorAccount.class, this.collectionName);
        return Optional.ofNullable(r).map(this::decode).orElse(null);
    }
This is {@link MongoDbGoogleAuthenticatorTokenCredentialRepository}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-gauth-mongo/src/main/java/org/apereo/cas/gauth/credential/MongoDbGoogleAuthenticatorTokenCredentialRepository.java