Think/Model/MongoModel.php
public function distinct($field, $where = [])
    {
        // 分析表达式
        $this->options = $this->_parseOptions();
        $this->options['where'] = array_merge((array)$this->options['where'], $where);

        $command = [
            "distinct" => $this->options['table'],
            "key"      => $field,
            "query"    => $this->options['where'],
        ];

        $result = $this->command($command);

        return isset($result['values']) ? $result['values'] : false;
    }
public function distinct($field, $where = [])
    {
        // 分析表达式
        $this->options = $this->_parseOptions();
        $this->options['where'] = array_merge((array)$this->options['where'], $where);

        $command = [
            "distinct" => $this->options['table'],
            "key"      => $field,
            "query"    => $this->options['where'],
        ];

        $result = $this->command($command);

        return isset($result['values']) ? $result['values'] : false;
    }
获取唯一值

@return array | false