Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Filter Scopes

Every built-in filter type, with what it offers and what reaches the query. The keys every filter takes (label, default_value, permission) are on Filters.

boolean

filters:
  featured: { type: boolean }
OffersMatches
Yes or noRows where the column is true (1) or false (0).

select

filters:
  status:
    type: select
    options: [{ value: draft, label: Draft }, { value: live, label: Live }]
    default_value: live
  country: { type: select, options: acme.countries }
  state:   { type: select, options: acme.states, depends_on: country }
KeyDescription
optionsThe choices: a list of { value, label }, or the name of an option source. Required.
depends_onA filter, or a list of filters, whose values the source reads through OptionCx::values. When one changes, this filter’s choices are asked for again, and a value no longer offered is dropped.
OffersMatches
One of the declared valuesRows equal to it. A value not declared is dropped.

text

filters:
  author: { type: text }
OffersMatches
A text boxRows containing the text, folded the way the search box folds.

number

filters:
  views: { type: number }
OffersMatches
A number boxRows equal to the whole number. Anything else is dropped.

date

filters:
  created_at: { type: date }
OffersMatches
A date pickerRows on that YYYY-MM-DD day, whether the column holds a date or a timestamp.