Appends a or-where-regex statement

@param string $field field name
@param mixed  $value filter value

@return object $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;
    }
1195276
public function where($field, $operator = null, $value = null) {
        if (strlen($field) && is_null($operator) && is_null($value)) {
            // For RAW string
            array_push($this->_where, $field);
        } else {
            if (is_null($value)) {
                $value = $operator;
                $operator = '=';
            }

            if (is_array($value)) {
                $str = '(';
                
                for ($i = 0; $i < count($value); $i++) {
                    $d = $value[$i];
                    $str .= is_numeric($d) ? $d : "'$d'";
                    $str .= count($value) === $i + 1 ? '' : ', ';
                }
                
                $str .= ')';
                
                $value = $str;
                
                array_push($this->_where, $field . ' ' . $operator . $value);
            } else {
                $value = (string)$value;
                array_push($this->_where, $field . ' ' . $operator . (!strcasecmp($operator, 'in') ? " ($value)" : ' \'' . $value . '\''));
            }
        }
        
        return $this;
    }
217382
public function whereEndsWith($field, $value)
    {
        foreach ($this->queries as $query) {
            $query->whereEndsWith($field, $value);
        }

        return $this;
    }
150702
public function where($field, $operator = null, $value = null)
    {
        $this->query->where($field, $operator, $value);

        return $this;
    }
351665
public function whereNotEndsWith($field, $value)
    {
        foreach ($this->queries as $query) {
            $query->whereNotEndsWith($field, $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;
    }
146662
public function whereEq($field, $value)
    {
        $bind_key = strpos($field, '.') !== false ? strtr($field, '.', '_') : $field;
        $normalizedField = preg_replace('#\w+#', '[\\0]', $field);
        $this->_conditions[] = "$normalizedField=:$bind_key";
        $this->_bind[$bind_key] = $value;

        return $this;
    }
646648
public function xorWhere($field, $op = null, $value = null) {
        return $this->_modifyPredicate($this->_where, Predicate::MAYBE, $field, $op, $value);
    }
708274
public function orWhere($field, $op = null, $value = null) {
        return $this->_modifyPredicate($this->_where, Predicate::EITHER, $field, $op, $value);
    }
647680
private function buildContains($field, $value)
    {
        return $this::$open.$field.Operator::$equals.Operator::$wildcard.$value.Operator::$wildcard.$this::$close;
    }
3788
public function addColumn($field, $value)
    {
        if (!isset($this->query['columns'])) {
            $this->query['columns'] = [];
        }
        $this->query['columns'][$field] = $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);
    }
393402
public function addField(string $field, string $value): self
    {
        $this->fields[$field] = $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;
    }
511926
public function whereEq($field, $value)
    {
        $this->_filters[] = [$field => $this->normalizeValue($field, $value)];

        return $this;
    }
1193417
public function whereId($value, $field = '_id')
    {
        if (! $value instanceof MongoId) {
            $value = new MongoId($value);
        }

        return $this->formatWhere('$and', $field, $value);
    }