@Override
    public void remove(final ZonedDateTime expirationDate) {
        try {
            val query = new Query();
            query.addCriteria(Criteria.where("expirationDate").lte(expirationDate));
            val res = mongoTemplate.remove(query, MultifactorAuthenticationTrustRecord.class,
                getTrustedDevicesMultifactorProperties().getMongo().getCollection());
            LOGGER.info("Found and removed [{}] for query [{}]", res.getDeletedCount(), query);
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        }
    }
This is {@link MongoDbMultifactorAuthenticationTrustStorage}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-trusted-mfa-mongo/src/main/java/org/apereo/cas/trusted/authentication/storage/MongoDbMultifactorAuthenticationTrustStorage.java