Current API (v0.1)
v0.1 uses string-based filters. The target API will use generated typed accessors for better type safety.
Filter by Equality
Match records where a field equals a specific value:Comparison Operators
ChameleonDB supports these comparison operators:| Operator | Meaning | Example |
|---|---|---|
eq | Equal | Filter("age", "eq", 25) |
neq | Not equal | Filter("status", "neq", "deleted") |
gt | Greater than | Filter("age", "gt", 18) |
gte | Greater than or equal | Filter("age", "gte", 18) |
lt | Less than | Filter("total", "lt", 100) |
lte | Less than or equal | Filter("total", "lte", 100) |
like | Contains (pattern) | Filter("name", "like", "ana") |
in | In list | Filter("status", "in", [...]) |
Greater Than or Equal
Multiple Filters (AND)
Multiple.Filter() calls are combined with AND:
Like (Pattern Matching)
Match strings usinglike. Wildcards (%) are added automatically:
ChameleonDB automatically wraps the search term with
% wildcards for convenient substring matching.In (Multiple Values)
Match against a list of values:Filter on Related Entity
Filter the main entity based on a condition on a related entity:Filter on Relation + Include
You can filter on a relation and also include it. The filter affects which users are returned; the include loads all their orders (not just matching ones):The filter determines which users match. The include loads all related data for those users, not just the filtered subset.