← Back to Features
02

Expressive Query Language

Filter documents using a concise query syntax built into the URL. Combine multiple conditions with semicolons, match values inside arrays with dot notation, and let VividEcho handle type coercion automatically. It's all expressed through the q parameter on a collection read — no query language to learn beyond a handful of operators.

Clauses and operators

A filter is built from one or more clauses in the form field:operator:value, joined with a semicolon when you need more than one — all clauses must match, since they're combined with "and." As a shorthand, you can drop the operator entirely to mean "equals": q=field:value.

OperatorMeaningExample
eqEqualsq=status:eq:active
neNot equalsq=status:ne:archived
gtGreater thanq=price:gt:50
ltLess thanq=price:lt:100
gteGreater than or equalq=price:gte:50
lteLess than or equalq=price:lte:100
inMatches any in a listq=category:in:[books,games,music]

Arrays, type coercion, and text matches

Values are interpreted by type automatically — something that looks like a number becomes a number, something that looks like a date becomes a date — so you rarely have to think about it. If you do need to force a text match against a value that looks numeric, wrap it in quotes, and VividEcho will match it as a literal string instead of coercing it.

When a field holds an array of objects, you can reach inside it with the field[*].subfield syntax to match records that have at least one array element satisfying the clause. The bracket-and-dot token is exactly [*]., and a malformed filter is rejected outright rather than silently ignored, so a syntax mistake shows up immediately instead of quietly returning the wrong results.

# Equals, range, list membership
?q=status:eq:active;price:lt:100
?q=tags:in:[sale,new]
# Nested array matching
?q=items[].sku:eq:ABC123

← Back to Features