Think/Db/Driver/Mongo.php
public function insert($data, $options = [], $replace = false)
    {
        if (isset($options['table'])) {
            $this->switchCollection($options['table']);
        }
        $this->model = $options['model'];
        $this->executeTimes++;
        if ($this->config['debug']) {
            $this->queryStr = $this->_dbName.'.'.$this->_collectionName.'.insert(';
            $this->queryStr .= $data ? json_encode($data) : '{}';
            $this->queryStr .= ')';
        }
        try {
            $this->debug(true);
            $result = $replace ? $this->_collection->save($data) : $this->_collection->insert($data);
            $this->debug(false);
            if ($result) {
                $_id = $data['_id'];
                if (is_object($_id)) {
                    $_id = $_id->__toString();
                }
                $this->lastInsID = $_id;
            }

            return $result;
        } catch (\MongoCursorException $e) {
            E($e->getMessage());
        }
    }
public function insert($data, $options = [], $replace = false)
    {
        if (isset($options['table'])) {
            $this->switchCollection($options['table']);
        }
        $this->model = $options['model'];
        $this->executeTimes++;
        if ($this->config['debug']) {
            $this->queryStr = $this->_dbName.'.'.$this->_collectionName.'.insert(';
            $this->queryStr .= $data ? json_encode($data) : '{}';
            $this->queryStr .= ')';
        }
        try {
            $this->debug(true);
            $result = $replace ? $this->_collection->save($data) : $this->_collection->insert($data);
            $this->debug(false);
            if ($result) {
                $_id = $data['_id'];
                if (is_object($_id)) {
                    $_id = $_id->__toString();
                }
                $this->lastInsID = $_id;
            }

            return $result;
        } catch (\MongoCursorException $e) {
            E($e->getMessage());
        }
    }
插入记录
@param mixed $data 数据
@param array $options 参数表达式
@param boolean $replace 是否replace
@return false | integer