driver-core/src/main/com/mongodb/client/model/Projections.java
public static Bson slice(final String fieldName, final int skip, final int limit) {
        return new BsonDocument(fieldName, new BsonDocument("$slice", new BsonArray(asList(new BsonInt32(skip), new BsonInt32(limit)))));
    }
public static Bson slice(final String fieldName, final int skip, final int limit) {
        return new BsonDocument(fieldName, new BsonDocument("$slice", new BsonArray(asList(new BsonInt32(skip), new BsonInt32(limit)))));
    }
public static Bson slice ( final String fieldName , final int skip , final int limit ) { return new BsonDocument ( fieldName , new BsonDocument ( "$slice" , new BsonArray ( asList ( new BsonInt32 ( skip ) , new BsonInt32 ( limit ) ) ) ) ) ; }
Creates a projection to the given field name of a slice of the array value of that field.

@param fieldName the field name
@param skip      the number of elements to skip before applying the limit
@param limit     the number of elements to project
@return the projection
@mongodb.driver.manual reference/operator/projection/slice Slice
Creates a projection to the given field name of a slice of the array value of that field .