@Override
    public Collection<CredentialRegistration> getRegistrationsByUsername(final String username) {
        val query = new Query().addCriteria(Criteria.where(MongoDbWebAuthnCredentialRegistration.FIELD_USERNAME).is(username))
            .collation(Collation.of(Locale.ENGLISH).strength(Collation.ComparisonLevel.primary()));
        val records = mongoTemplate.find(query, MongoDbWebAuthnCredentialRegistration.class,
            getProperties().getAuthn().getMfa().getWebAuthn().getMongo().getCollection());
        return records.stream()
            .map(record -> getCipherExecutor().decode(record.getRecords()))
            .map(Unchecked.function(record -> WebAuthnUtils.getObjectMapper()
                .readValue(record, new TypeReference<Set<CredentialRegistration>>() {
                })))
            .flatMap(Collection::stream)
            .collect(Collectors.toList());
    }
This is {@link MongoDbWebAuthnCredentialRepository}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-webauthn-mongo/src/main/java/org/apereo/cas/webauthn/MongoDbWebAuthnCredentialRepository.java