driver-core/src/main/com/mongodb/client/model/IndexOptions.java
@Nullable
    public Long getExpireAfter(final TimeUnit timeUnit) {
        if (expireAfterSeconds == null) {
            return null;
        }
        return timeUnit.convert(expireAfterSeconds, TimeUnit.SECONDS);
    }
@Nullable
    public Long getExpireAfter(final TimeUnit timeUnit) {
        if (expireAfterSeconds == null) {
            return null;
        }
        return timeUnit.convert(expireAfterSeconds, TimeUnit.SECONDS);
    }
Gets the time to live for documents in the collection

@return the time to live for documents in the collection
@param timeUnit the time unit
@mongodb.driver.manual tutorial/expire-data TTL