Skip to content

Base filters

Default filter

The default filter model is a base model that can be used to create more specific filter models.

/** A base filter model that can be used to create more specific filter models */
model DefaultFilter {
/** The operator to apply to the filter value */
operator:
| ComparisonOperators
| ArrayOperators
| StringOperators
| RangeOperators
| AllOperators;
/** The value to use for the filter operation */
value: unknown;
}

EquivalenceOperators

Operators that filter a field based on an exact match to a value. Supported value types include:

  • string
  • number
  • boolean
  • date
  • money
OperatorDescriptionPropertyTrue valueFalse value
eqEqual to a value"foo""foo""bar"
neqNot equal to a value"foo""bar""foo"

ComparisonOperators

Operators that filter a field based on a comparison to a value. Supported value types include:

  • number
  • date
  • money
OperatorDescriptionPropertyTrue valueFalse value
gtGreater than a value10155
gteGreater than or equal to a value10109
ltLess than a value10515
lteLess than or equal to a value101011

StringOperators

Operators that filter a field based on a string value.

OperatorDescriptionPropertyTrue valueFalse value
likeLike"hello""hell""world"
not_likeNot like"hello""world""hell"

ArrayOperators

Operators that filter a field based on an array of values. Supported value types include:

  • string
  • number
OperatorDescriptionPropertyTrue valueFalse value
inIn an array of values"A"["A", "B"]["B", "C"]
not_inNot in an array of values"A"["B", "C"]["A", "B"]

RangeOperators

Operators that filter a field based on a range of values. Supported value types include:

  • number
  • date
  • money
OperatorDescriptionPropertyTrue valueFalse value
betweenThe value must be between the two values5{"min": 1, "max": 10}{"min": 10, "max": 20}
outsideThe value must be outside the two values5{"min": 10, "max": 20}{"min": 1, "max": 10}