Developers · Data
Filtering and Sorting
Last updated 1 November 2026
Choose which records a query returns and in what order, with property filters and sort.
Filters choose which records a query returns, and sort chooses their order. Both are arguments of the records and users queries. Filtering matches exact conditions on your fields; for ranked text search, use the fulltext condition or the search pages instead.
Filter by property
Give the table, then one condition per property. All conditions must match:
Query
{
records(
per_page: 5
filter: {
table: { value: "modules/website/developers_guide" }
properties: [{ name: "slug", value_in: ["layouts", "date-format", "no-such-slug"] }]
}
sort: [{ properties: [{ name: "slug", order: ASC }] }]
) {
total_entries
results { id slug: property(name: "slug") }
}
}Response on the docs instance
{
"data": {
"records": {
"total_entries": 2,
"results": [
{ "id": "1465", "slug": "date-format" },
{ "id": "1485", "slug": "layouts" }
]
}
}
}This ran read-only on the docs.insites.io instance on 1 November 2026. The slug that does not exist simply matches nothing.
Property operators
| Operator | Matches when the value |
|---|---|
value | Equals this text |
value_in | Is one of these values |
value_int, value_float, value_boolean | Equals this number or boolean. Faster than value for those types |
contains, starts_with, ends_with | Contains, starts or ends with the text. Not case sensitive unless case_sensitive: true |
range | Is within gt, gte, lt and lte |
exists | Is present (true) or missing (false) |
not_value, not_value_in, not_contains and others | Does not match. Records without the property also match |
A search for contains: "flash" on the title found the page titled Form Flash Messages, which shows the default is not case sensitive. Use or for alternatives, and created_at or updated_at with gte and lte for dates.
Sort
sort: [
{ properties: [{ name: "order", order: ASC }] }
{ created_at: { order: DESC } }
]Entries apply in the order given. Records without a value for the sort property come last. order_by_values on a field puts chosen values first.
Common mistakes
- Sorting by a number stored as text. Property sort compares text, so 10 comes before 2. Store fixed-width values, or read with
property_intand sort in Liquid. - Filtering a number with
value. It compares as text; usevalue_int. - Leaving out
table. Without it, property conditions cannot detect property types. - Forgetting
per_page. It is required.