# filter Package

This page lists the exported API of `core/store/filter`, which builds and evaluates `QUERY` and `FIND` conditions.

## Types and Functions

```go
type Filter interface {
    Match(obj any) bool
}

type Operator int
const (
    EqualTo Operator = iota
    GreaterThan
    GreaterThanOrEqualTo
    LessThan
    LessThanOrEqualTo
    NotEqualTo
    Like
)

type Cond struct {
    Field string
    Op    Operator
    Value string
}

type And []Filter
type Or []Filter
type Not [1]Filter

func AtoFilter(str string) (Filter, error)
func AtoOperation(s string) (Operator, bool)
func Match(stored string, op Operator, target string) bool
```

Shorthand conditions `EQ`, `NE`, `GT`, `GTE`, `GE`, `LT`, `LTE`, `LE`, and `LIKE` each have `Field` and `Value` string fields. `Parser` (`Or`, `And`, `Not`, `Primary`, `Current`) is exported and used by `AtoFilter`.

## Related Pages

- [QUERY Expressions](/querying-query)
- [Operators and FIND](/querying-operators)
- [utils](/api-reference-utils)
