class OfferLogCompactionDatabaseService {

    public CloseableIterable<CompactedOfferLog> getAscendingOfferLogCompactionBy(String containerName, Long offset) {
        Bson searchFilterCompaction = offset != null
            ? and(eq(CONTAINER, containerName), gte(SEQUENCE_START, offset))
            : eq(CONTAINER, containerName);

        Bson sequenceSort = Sorts.orderBy(Sorts.ascending(SEQUENCE_START));
        return toCloseableIterable(
            offerLogCompactionCollection.find(searchFilterCompaction)
            .sort(sequenceSort)
            .map(this::transformDocumentToOfferLogCompaction)
        );
    }

    public  OfferLogCompactionDatabaseService(MongoCollection<Document> offerLogCompactionCollection);

}