Resolves :or: and then :and: links

@param Builder $query
@param $field
@param $value
@return Builder
161778
private function applyFieldFilter(Builder $query, $field, $value)
    {
        $query = $this->resolveOrLinks($query, $field, $value);

        return $query;
    }
1268427
function where($field, $operator, $value)
    {
        switch ($operator) {
            //EQUALITY
            case '=':
                $this->requestDecorator->addParameter($field, '=', $value);
                break;
            //INEQUALITY
            case '!=':
            case '[ne]':
            case 'ne':
                $this->requestDecorator->addParameter($field, '[ne]', $value);
                break;
            //INCLUSION
            case '[in]':
            case 'in':
                $this->requestDecorator->addParameter($field, '[in]', $value);
                break;
            //EXCLUSION
            case '[nin]':
            case 'nin':
                $this->requestDecorator->addParameter($field, '[nin]', $value);
                break;
            //LESS THAN
            case '<':
            case '[lt]':
            case 'lt':
                $this->requestDecorator->addParameter($field, '[lt]', $value);
                break;
            //GREATER THAN
            case '>':
            case '[gt]':
            case 'gt':
                $this->requestDecorator->addParameter($field, '[gt]', $value);
                break;
            //LESS THAN OR EQUAL TO
            case '<=':
            case '[lte]':
            case 'lte':
                $this->requestDecorator->addParameter($field, '[lte]', $value);
                break;
            //GREATER THAN OR EQUAL TO
            case '>=':
            case '[gte]':
            case 'gte':
                $this->requestDecorator->addParameter($field, '[gte]', $value);
                break;
            //MATCH
            case 'match':
            case '[match]':
                $this->requestDecorator->addParameter($field, '[match]', $value);
                break;
            //LOCATION - NEAR
            case 'near':
            case '[near]':
                $this->requestDecorator->addParameter($field, '[near]', $value);
                break;
            //LOCATION - WITHIN
            case 'within':
            case '[within]':
                $this->requestDecorator->addParameter($field, '[within]', $value);
                break;
            default:
                $this->requestDecorator->addParameter($field, '[' . $operator . ']', $value);
        }
        return $this;
    }
568046
public function orWhere($field, $value = null)
    {
        if ($field instanceof Closure) {
            return $this->formatWhere('$or', $field);
        }

        return $this->formatWhere('$or', $field, $value);
    }
1319810
public function andWhere($column, $relation, $value, $link = false)
    {
        if (!$link) {
            $this->where .= " and ( $column $relation '$value' )";
        } else {
            $this->where .= " and ( $column $relation $value )";
        }

        //
        return $this;
    }
1213685
private function addCondition(string $link, $field, $value, string $operator)
    {
        $this->where[] = [
          'link' => $link,
          'field' => $field,
          'operator' => $operator,
          'value' => $value
        ];

        return $this;
    }
1067850
protected function _buildQuery(Query $query, $field, $value, array $data = [])
    {
        $value = '%' . $value . '%';

        return $query->where(
            function ($exp) use ($field, $value) {
                return $exp->like($field, $value);
            }
        );
    }
773108
public function oneBy(string $field, $value)
    {
        $model = $this->queryRelate->where($field, $value)->getQuery()->first();

        $this->resetQueryRelate();

        return $model;
    }
271307
public function apply(Builder $query, $or = false)
    {
        $field_alias = $this->field_alias;

        if($or)
        {
            $query->orWhere($field_alias, '<', $this->value);
        }
        else
        {
            $query->where($field_alias, '<', $this->value);
        }
    }
1179727
public function where(string $key, string $operator, $value): QueryBuilder
    {
        $this->addWhere($key, $operator, $value, 'AND');
        return $this;
    }
975435
public function orWhereRegex($field, $value)
    {
        if (! $value instanceof MongoRegex) {
            $value = new MongoRegex($value);
        }

        return $this->formatWhere('$or', $field, $value);
    }
32007
public function orWhere(string $key, string $operator, $value): QueryBuilder
    {
        $this->addWhere($key, $operator, $value, 'OR');
        return $this;
    }
865941
public function process(ExprBuilder $builder, $field, $expression, $value)
    {
        if (!Expr::isValidExpression($expression)) {
            throw new ParserException(sprintf(
                'The expression "%s" is not allowed or not exists.',
                $expression
            ));
        }

        switch ($expression) {
            case 'between':
                set_error_handler(function () use ($value) {
                    throw new ParserException(sprintf(
                        'The value of "between" expression "%s" is not valid.',
                        $value
                    ));
                });

                list($from, $to) = explode('-', $value);

                restore_error_handler();

                return $builder->between($field, $from, $to);
            case 'paginate':
                set_error_handler(function () use ($value) {
                    throw new ParserException(sprintf(
                        'The value of "paginate" expression "%s" is not valid.',
                        $value
                    ));
                });

                list($currentPageNumber, $maxResultsPerPage) = explode('-', $value);

                restore_error_handler();

                return $builder->paginate($currentPageNumber, $maxResultsPerPage);
            case 'or':
                return $builder->orx($value);
            default:
                return $builder->{$expression}($field, $value);
        }
    }
118072
public function whereEq($field, $value)
    {
        foreach ($this->queries as $query) {
            $query->whereEq($field, $value);
        }

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

        return $this;
    }
516394
public function or(string $field, string $operator, string $field2)
    {
        $this->and($field, $operator, $field2);
        $this->convertToOrJunction();

        return $this;
    }
922801
private function buildDoesNotEqual($field, $value)
    {
        return $this::$open.Operator::$doesNotEqual.$this->buildEquals($field, $value).$this::$close;
    }
426571
protected function parseValue($value, $field = '')
    {
        unset($field);
        if (is_string($value)) {
            $value = strpos($value, ':') === 0 && $this->query->isBind(substr($value, 1)) ? $value : $this->connection->quote($value);
        } elseif (is_array($value)) {
            $value = array_map([$this, 'parseValue'], $value);
        } elseif (is_bool($value)) {
            $value = $value ? '1' : '0';
        } elseif (is_null($value)) {
            $value = 'null';
        }
        return $value;
    }