mongodb/src/main/java/de/taimos/dvalin/mongo/ChangelogUtil.java
/**
     * adds a TTL index to the given collection. The TTL must be a positive integer.
     *
     * @param collection the collection to use for the TTL index
     * @param field      the field to use for the TTL index
     * @param ttl        the TTL to set on the given field
     * @throws IllegalArgumentException if the TTL is less or equal 0
     */
adds a TTL index to the given collection. The TTL must be a positive integer.
@param collection the collection to use for the TTL index
@param field      the field to use for the TTL index
@param ttl        the TTL to set on the given field
@throws IllegalArgumentException if the TTL is less or equal 0
adds a TTL index to the given collection . The TTL must be a positive integer . @param collection the collection to use for the TTL index @param field the field to use for the TTL index @param ttl the TTL to set on the given field @throws IllegalArgumentException if the TTL is less or equal 0
public static void addTTLIndex(DBCollection collection, String field, int ttl) {
        if (ttl <= 0) {
            throw new IllegalArgumentException("TTL must be positive");
        }
        collection.createIndex(new BasicDBObject(field, 1), new BasicDBObject("expireAfterSeconds", ttl));
    }
public static void addTTLIndex ( DBCollection collection , String field , int ttl ) { if ( ttl <= 0 ) { throw new IllegalArgumentException ( "TTL must be positive" ) ; } collection . createIndex ( new BasicDBObject ( field , 1 ) , new BasicDBObject ( "expireAfterSeconds" , ttl ) ) ; }
adds a TTL index to the given collection.
adds a TTL index to the given collection .