@Override
    public List<? extends AuditActionContext> getAuditRecords(final Map<WhereClauseFields, Object> whereClause) {
        val localDate = (LocalDateTime) whereClause.get(WhereClauseFields.DATE);
        val dt = DateTimeUtils.dateOf(localDate);
        LOGGER.debug("Retrieving audit records since [{}] from [{}]", dt, this.collectionName);
        val query = new Query().addCriteria(Criteria.where("whenActionWasPerformed").gte(dt));
        if (whereClause.containsKey(WhereClauseFields.PRINCIPAL)) {
            query.addCriteria(Criteria.where("principal").is(whereClause.get(WhereClauseFields.PRINCIPAL).toString()));
        }
        if (whereClause.containsKey(WhereClauseFields.COUNT)) {
            query.limit(Long.valueOf(whereClause.get(WhereClauseFields.COUNT).toString()).intValue());
        }
        return new ArrayList<>(this.mongoTemplate.find(query, AuditActionContext.class, this.collectionName));
    }
This is {@link MongoDbAuditTrailManager}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-audit-mongo/src/main/java/org/apereo/cas/audit/MongoDbAuditTrailManager.java