设置软删除字段及条件
@access public
@param false|string  $field     查询字段
@param mixed         $condition 查询条件
@return $this
420101
public function useSoftDelete($field, $condition = null)
    {
        if ($field) {
            $this->options['soft_delete'] = [$field, $condition ?: ['null', '']];
        }
        return $this;
    }
992014
public function setField($field = null)
    {
        $this->field = null;

        if (!$field = $this->internalResolveField($field)) {
            $this->field = $this->fieldId = null;
        } else {
            $this->fieldId = $field->id;
            $this->field = $field;
        }

        return $this;
    }
698307
public function whereIn($field, $condition, $logic = 'AND')
    {
        $this->parseWhereExp($logic, $field, 'in', $condition);
        return $this;
    }
232348
public function where($condition) 
    {       
        $this->condition = $condition;
        $this->sql .= ' WHERE ' . $this->buildCondition($condition);
        
        return $this;
    }
823780
public function field($field, $alias = null) {
        if (is_string($field)) {
            $fields = explode(',', trim($field));
            foreach ($fields as $field) {
                $this->fields [] = Condition::cleanField($field . ($alias ? ' AS ' . $alias : ''));
            }
        } else if ($field instanceof Query) {
            if ($alias) {
                $field->alias($alias);
            }
            $this->fields [] = $field;
        } else if ($field instanceof ImmutableValue) {
            if ($alias) {
                $field->alias($alias);
            }
            $this->fields [] = $field;
        }

        return $this;
    }
905061
public function field(...$fields)
    {
        if(!isset($fields[1]) && is_array($fields[0]))
        {
            $this->option->field = array_merge($this->option->field, $fields[0]);
        }
        else
        {
            $this->option->field = array_merge($this->option->field, $fields);
        }
        return $this;
    }
811522
public function setCondition(array $condition)
    {
        if (!isset($condition['function'])) {
            return false;
        }

        $this->conditional_function = $condition['function'];

        if (isset($condition['parameters'])) {
            $this->conditional_parameters = (array) $condition['parameters'];
        }

        if (isset($condition['inverse'])) {
            $this->conditional_inverse = (boolean) $condition['inverse'];
        }
    }
168709
public function whereBetween($field, $condition, $logic = 'and')
    {
        $this->parseWhereExp($logic, $field, 'between', $condition);
        return $this;
    }
514637
public function select($fields)
    {
        if (!$fields) {
            return $this;
        }

        if (is_string($fields)) {
            $fields = (array)preg_split('#[\s,]+#', $fields, -1, PREG_SPLIT_NO_EMPTY);
        }

        $r = '';
        /** @noinspection ForeachSourceInspection */
        foreach ($fields as $k => $v) {
            if (strpos($v, '[') === false && strpos($v, '(') === false) {
                /** @noinspection NotOptimalIfConditionsInspection */
                if (is_int($k)) {
                    $r .= preg_replace('#\w+#', '[\\0]', $v) . ', ';
                } else {
                    $r .= preg_replace('#\w+#', '[\\0]', $v) . ' AS [' . $k . '], ';
                }
            } elseif (is_int($k)) {
                $r .= $v . ', ';
            } else {
                $r .= $v . ' AS [' . $k . '], ';
            }
        }
        $this->_fields = substr($r, 0, -2);

        return $this;
    }
608436
public function where_in($field = '', $in = array())
	{
		$this->_where_init($field);
		$this->wheres[$field]['$in'] = $in;
		return $this;
	}
723155
public function addField(Field $field)
    {
        if (array_search($field, $this->fields) === false)
            $this->fields[] = $field;
    }
603072
public function equals(\Skeleton\Pager\Sql\Condition $condition) {
		if ($this->get_local_field() != $condition->get_local_field()) {
			return false;
		}

		if ($this->get_comparison() == '=' AND $condition->get_comparison() == 'IN') {
			foreach ($condition->get_value() as $value) {
				if (in_array($value, $this->get_value())) {
					return true;
				}
			}
		}

		if ($condition->get_comparison() == '=' AND $this->get_comparison() == 'IN') {
			foreach ($this->get_value() as $value) {
				if (in_array($value, $condition->get_value())) {
					return true;
				}
			}
		}

		if ($this->get_comparison() != $condition->get_comparison()) {
			return false;
		}

		if (!is_array($this->get_value()) and !is_array($condition->get_value())) {
			if ($this->get_value() != $condition->get_value()) {
				return false;
			}
		} elseif (is_array($this->get_value()) and is_array($condition->get_value())) {
			$diff = array_diff($this->get_value(), $condition->get_value());
			if (count($diff) > 0) {
				return false;
			}
		} else {
			return false;
		}

		return true;
	}
1232189
public function flipBoolValue($field)
    {
        $this->setField($field, (int)!$this->getField($field));

        return $this;
    }
88565
public function allowField($field)
    {
        if (is_string($field)) {
            $field = explode(',', $field);
        }

        $this->field = $field;

        return $this;
    }
830863
public function whereNotIn($field, $condition, $logic = 'AND')
    {
        $this->parseWhereExp($logic, $field, 'not in', $condition);
        return $this;
    }
1091606
public function kv($field,$condition = NULL, $params = NULL) {
		return $this->driver
            ->field($field)
            ->where($condition,$params)
            ->kv();
	}
1319004
public function pull(string $field, $condition)
    {
        $this->update();
        $this->mongoDbUpdate['$pull'][$field] = $condition;

        return $this;
    }