DocsQueries & lists · FQL
On this page

Query a list

Declare list filters, sorting and pagination state.

Before you begin: Summarize transactions.

Lists in State

Define list selectors in state. The same object controls source, filters, ordering, and limits.

FQL state configuration

Add this configuration inside your page’s {STATE} declaration. Inspect state shows its configuration; live queries and saved data run against your local site. Try a complete FQL page →

$list can be a post type, $posts.type, $transactions, or $settings.path.to.array. The $where object supports equality keys plus suffixes like price.$gte, tag.$contains, and tag.$startsWith.

Money fields use a currency-aware comparison value. The comparison is made only against that currency's entry, so USD and NGN amounts are never mixed:

FQL state configuration

Add this configuration inside your page’s {STATE} declaration. Inspect state shows its configuration; live queries and saved data run against your local site. Try a complete FQL page →

Use balance: { currency: "USD", amount: "1000.00" } for equality. Money supports $gt, $gte, $lt, $lte, and $ne; text operators such as $contains do not apply. The query field is included in the theme's automatic index contract when the selector is processed, so theme developers do not need to declare an index manually.

Supported list selector keys:

KeyExample
$list"$list": "products"
$where"$where": { "status": "published", "price.$gte": 1000 }
$order"$order": { "createdAt": "desc" }
$limit"$limit": 6
$page"$page": 1

Plain keys such as source, where, order, limit, and page are ordinary data fields. They are not list selector controls.

After the list renders, Frontbacked exposes paging metadata and items through $lists.<listId>:

js

Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →

When pagination loads a new page from the server, Frontbacked replaces the list items with the new page instead of appending them.

Each list item has this shape:

js

Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →

The id, type, createdOn, and updatedOn values are the same system-generated post fields available on single post lookups. They are added by Frontbacked when posts are read into list items.

Inside list templates, $ is the current item. Read system fields from $ and theme-owned fields from $.data.

index.html

Continue with Build a data page.