driver-legacy/src/main/com/mongodb/DBCollection.java
public List distinct(final String fieldName, final DBObject query) {
        return distinct(fieldName, query, getReadPreference());
    }
public List distinct(final String fieldName, final DBObject query) {
        return distinct(fieldName, query, getReadPreference());
    }
public List distinct ( final String fieldName , final DBObject query ) { return distinct ( fieldName , query , getReadPreference ( ) ) ; }
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 query     specifies the selection query to determine the subset of documents from which to retrieve the distinct values
@return an array of the distinct values
@mongodb.driver.manual reference/command/distinct Distinct Command
Find the distinct values for a specified field across a collection and returns the results in an array .