driver-legacy/src/main/com/mongodb/DBCollection.java
public List distinct(final String fieldName, final ReadPreference readPreference) {
        return distinct(fieldName, new BasicDBObject(), readPreference);
    }
public List distinct(final String fieldName, final ReadPreference readPreference) {
        return distinct(fieldName, new BasicDBObject(), readPreference);
    }
Find the distinct values for a specified field across a collection and returns the results in an array.

@param fieldName      Specifies the field for which to return the distinct values
@param readPreference {@link ReadPreference} to be used for this operation
@return a List of the distinct values
@mongodb.driver.manual reference/command/distinct Distinct Command