Concourse uses the Concourse Command Language (CCL) to express
conditions for finding records. Queries are used with the find
method to locate records, and can also be passed to read, write,
and aggregation methods to filter their scope.
For the complete CCL language specification — including all
commands, functions, and formal syntax — see the
CCL Reference.
CCL is a human-readable query language for expressing conditions
on record data. A CCL expression evaluates against every record in
the database and returns those that match.
You can use dot-separated navigation keys in CCL conditions to
query across linked records. See Graph for details.
1
employer.name = "Cinchapi"
This finds all records whose linked employer record has a
name of "Cinchapi".
Navigation keys in Criteria also support the *transitive modifier, which
lets a single condition match against any value reachable via
recursive link traversal:
1
children*.name = "Bob"
123
// Java — ancestors of any descendant named "Bob"Set<Long>records=concourse.find("children*.name",Operator.EQUALS,"Bob");
CCL supports querying against historical data by appending a
timestamp clause:
1
age > 30 at "January 1, 2025"
For mixed-time conditions, attach a [<timestamp>] bracket
directly to a leaf key. Each bracketed leaf evaluates at its own
pinned moment, independent of any trailing at/as of on the
expression:
1234
findtier="PLATINUM"andlifetime_spend["end of last quarter"] >=100000--evaluatestieragainstthepresentmoment--evaluateslifetime_spendatthecloseoflastquarter
Brackets follow the same precedence rule everywhere they appear:
the bracket wins for the key it sits on, and the trailing
at/as of default-fills any unbracketed leaf. See
Per-Key Timestamps for the
full rule.
A function value is an aggregation result used as the
comparison value on the right-hand side of a condition. This
lets you write dynamic conditions that compare a key’s value
against a computed aggregate rather than a literal.
age > avg(age)
score >= min(score)
salary < max(salary)
This finds records where the key’s value exceeds (or meets) the
aggregate computed across all records. The function is evaluated
first, and the result is used as the comparison value.
Function values can also scope the aggregate to specific records
or a sub-condition:
1234
age > avg(age, 1, 2, 3)
score > avg(score, department = "Engineering")
age > avg(age, at "yesterday")
score > avg(score, active = true, at "last month")
The Criteria builder provides a type-safe, programmatic
alternative to CCL strings. The builder uses a state-machine
pattern to guide you through valid parameter sequences.
The find method returns the set of record IDs that match a
query. It accepts CCL strings, Criteria objects, or individual
key/operator/value parameters.