public function getDistinct($selector, $expression = null)
    {
        if ($expression) {
            return $this->getMongoCollection()->distinct(
                $selector,
                Expression::convertToArray($expression)
            );
        }

        return $this->getMongoCollection()->distinct($selector);
    }
public function getDistinct($selector, $expression = null)
    {
        if ($expression) {
            return $this->getMongoCollection()->distinct(
                $selector,
                Expression::convertToArray($expression)
            );
        }

        return $this->getMongoCollection()->distinct($selector);
    }
public function getDistinct ( $ selector , $ expression = null ) { if ( $ expression ) { return $ this -> getMongoCollection ( ) -> distinct ( $ selector , Expression :: convertToArray ( $ expression ) ) ; } return $ this -> getMongoCollection ( ) -> distinct ( $ selector ) ; }
Retrieve a list of distinct values for the given key across a collection.

@param string $selector field selector
@param array|callable|\Sokil\Mongo\Expression $expression expression to search documents
@return array distinct values
Retrieve a list of distinct values for the given key across a collection .