public function distinct($key, array $query = [])
    {
        try {
            return array_map([TypeConverter::class, 'toLegacy'], $this->collection->distinct($key, TypeConverter::fromLegacy($query)));
        } catch (\MongoDB\Driver\Exception\Exception $e) {
            return false;
        }
    }
public function distinct($key, array $query = [])
    {
        try {
            return array_map([TypeConverter::class, 'toLegacy'], $this->collection->distinct($key, TypeConverter::fromLegacy($query)));
        } catch (\MongoDB\Driver\Exception\Exception $e) {
            return false;
        }
    }
public function distinct ( $ key , array $ query = [ ] ) { try { return array_map ( [ TypeConverter :: class , 'toLegacy' ] , $ this -> collection -> distinct ( $ key , TypeConverter :: fromLegacy ( $ query ) ) ) ; } catch ( \ MongoDB \ Driver \ Exception \ Exception $ e ) { return false ; } }
Retrieve a list of distinct values for the given key across a collection

@link http://www.php.net/manual/ru/mongocollection.distinct.php
@param string $key The key to use.
@param array $query An optional query parameters
@return array|bool Returns an array of distinct values, or FALSE on failure
Retrieve a list of distinct values for the given key across a collection