单表插入添加数据
@param string $field
@param mixed $value
@return $this
3788
public function addColumn($field, $value)
    {
        if (!isset($this->query['columns'])) {
            $this->query['columns'] = [];
        }
        $this->query['columns'][$field] = $value;
        return $this;
    }
158096
public function addToSet(string $field, $value)
    {
        $this->update();
        $this->mongoDbUpdate['$addToSet'][$field] = $value;

        return $this;
    }
309016
public function notEq($field, $value) {
        if (is_array($value)) {
            $this->notIn($field, $value);

        } else if ($value === null) {
            $this->notNull($field);

        } else {
            $this->add($field, '!=', $value);
        }

        return $this;
    }
559459
public function addChange(
        string $field,
        $value,
        int $type = self::TYPE_VALUE
    ): self {
        $this->changes[] = [
            'field' => $field,
            'type' => $type,
            'value' => $value,
        ];

        return $this;
    }
316721
protected function setAsBoolean($field, $value)
    {
        if (in_array($field, $this->getColumns()) && (
                !array_key_exists($field, $this->object) ||
                $this->object[$field] !== $value
            )) {
            $this->dirtyFields[$field] = true;
        }
        $this->object[$field] = (bool) $value;

        return $this;
    }
969729
public function where($field, $value)
    {
        if (!isset($this->_expression[$field]) || !is_array($value) || !is_array($this->_expression[$field])) {
            $this->_expression[$field] = $value;
        } else {
            $this->_expression[$field] = array_merge_recursive($this->_expression[$field], $value);
        }

        return $this;
    }
696102
public function data($field, $value = null)
    {
        if (is_array($field)) {
            $this->options['data'] = isset($this->options['data']) ? array_merge($this->options['data'], $field) : $field;
        } else {
            $this->options['data'][$field] = $value;
        }

        return $this;
    }
1240928
protected function setAsInteger($field, $value)
    {
        if (in_array($field, $this->getColumns()) && (
                !array_key_exists($field, $this->object) ||
                $this->object[$field] !== $value
        )) {
            $this->dirtyFields[$field] = true;
        }
        $this->object[$field] = (int) $value;

        return $this;
    }
896122
public function loginBy($field, $value)
    {
        $this->model->tryLoadBy($field, $value);
        $this->memorizeModel();

        return $this;
    }
604762
protected function setAsString($field, $value)
    {
        if (in_array($field, $this->getColumns()) && (
                !array_key_exists($field, $this->object) ||
                $this->object[$field] !== $value
            )) {
            $this->dirtyFields[$field] = true;
        }
        $this->object[$field] = (string) $value;

        return $this;
    }
351665
public function whereNotEndsWith($field, $value)
    {
        foreach ($this->queries as $query) {
            $query->whereNotEndsWith($field, $value);
        }

        return $this;
    }
107179
public function oneByIntOrFail(string $field, int $value): Model
    {
        return $this->oneByOrFail($field, $value);
    }
837459
public function increment(string $field, $value)
    {
        $this->update();
        $this->mongoDbUpdate['$inc'][$field] = $value;

        return $this;
    }
1197625
public function set($field, $value = null)
    {
        if (func_num_args() == 1) {
            if (is_array($field)) {
                foreach ($field as $key => $value) {
                    if ($key === '0' || $key === 0) {
                        $this->set($value);
                    } else {
                        $this->set($key, $value);
                    }
                }

                return $this;
            } elseif ($field instanceof self) {
                $this->data = $field->data;
                //$this->id = $field->id;

                return $this;
            } else {
                $value = $field;
                $field = $this->title_field;
            }
        }

        $field = $this->normalizeFieldName($field);

        $f = $this->hasField($field);

        try {
            if ($f && $this->hook('normalize', [$f, $value]) !== false) {
                $value = $f->normalize($value);
            }
        } catch (Exception $e) {
            $e->addMoreInfo('field', $field);
            $e->addMoreInfo('value', $value);
            $e->addMoreInfo('f', $f);

            throw $e;
        }

        $default_value = $f ? $f->default : null;

        $original_value = array_key_exists($field, $this->dirty) ? $this->dirty[$field] :
            ((isset($f) && isset($f->default)) ? $f->default : null);

        $current_value = array_key_exists($field, $this->data) ? $this->data[$field] : $original_value;

        if (gettype($value) == gettype($current_value) && $value == $current_value) {
            // do nothing, value unchanged
            return $this;
        }

        if ($f) {
            // perform bunch of standard validation here. This can be re-factored in the future.
            if ($f->read_only) {
                throw new Exception([
                    'Attempting to change read-only field',
                    'field' => $field,
                    'model' => $this,
                ]);
            }

            // enum property support
            if (isset($f->enum) && $f->enum && $f->type != 'boolean') {
                if ($value === '') {
                    $value = null;
                }
                if ($value !== null && !in_array($value, $f->enum, true)) {
                    throw new Exception([
                        'This is not one of the allowed values for the field',
                        'field' => $field,
                        'model' => $this,
                        'value' => $value,
                        'enum'  => $f->enum,
                    ]);
                }
            }

            // values property support
            if ($f->values) {
                if ($value === '') {
                    $value = null;
                } elseif ($value === null) {
                    // all is good
                } elseif (!is_string($value) && !is_int($value)) {
                    throw new Exception([
                        'Field can be only one of pre-defined value, so only "string" and "int" keys are supported',
                        'field' => $field,
                        'model' => $this,
                        'value' => $value,
                        'values'=> $f->values,
                    ]);
                } elseif (!array_key_exists($value, $f->values)) {
                    throw new Exception([
                        'This is not one of the allowed values for the field',
                        'field'   => $field,
                        'model'   => $this,
                        'value'   => $value,
                        'values'  => $f->values,
                    ]);
                }
            }
        }

        if (array_key_exists($field, $this->dirty) && (
            gettype($this->dirty[$field]) == gettype($value) && $this->dirty[$field] == $value
        )) {
            unset($this->dirty[$field]);
        } elseif (!array_key_exists($field, $this->dirty)) {
            $this->dirty[$field] =
                array_key_exists($field, $this->data) ?
                $this->data[$field] : $default_value;
        }
        $this->data[$field] = $value;

        return $this;
    }
47129
public function in($field, $value) {
        $this->add($field, Expr::IN, (array) $value);

        return $this;
    }
727272
public function filterLte(string $field, $value): self
    {
        $this->filters[] = new IndexQueryFilter($field, IndexQueryFilterOperator::LESS_THAN_OR_EQUAL_TO(), $value);
        return $this;
    }
248300
public function setField($field,$value='') {
        if(is_array($field)) {
            $data           =   $field;
        }else{
            $data[$field]   =   $value;
        }
        return $this->save($data);
    }