Querying, Filtering & Sorting
Fetch records from any collection via GET /api/collections/:name/records:
GET /api/collections/posts/records?page=1&perPage=20&sort=-created_at&expand=author&fields=id,title,author.name&filter=(published=true && views>=100)Query Parameters
Section titled “Query Parameters”| Parameter | Example | Description |
|---|---|---|
page / perPage |
page=1&perPage=30 |
Offset pagination (default perPage=30, max 500) |
filter |
(status="active" || author=@request.auth.id) |
Parameterized filter expression |
sort |
-created_at,title |
Prefix - for descending order |
expand |
author,comments.user |
Eager-load related records |
fields |
id,title,author.email |
Return only selected fields |
Filter Operators
Section titled “Filter Operators”| Operator | Meaning |
|---|---|
= / != |
Equal / Not equal |
> / >= / < / <= |
Numeric or date comparison |
~ / !~ |
Case-insensitive contains (ILIKE / NOT ILIKE) |
&& / || |
Logical AND / OR (supports parentheses) |
Security: Filter expressions are compiled into parameterized SQL and automatically reject sensitive columns (
password_hash,token_key) and internal system tables (_superusers,_settings,_oauth_providers).