Stages joined by pipes
collection("patients") | sort(.admitted; desc) | limit(2)
This reads the patients collection, orders by admission date with the newest first, and keeps two.
Checked before it runs
Before anything is read, the service checks every word against the served words. A word that is not served, a stage in the wrong place, or an argument of the wrong form is refused.
The refusal carries a code, a sentence, and the span of text that caused it. It is part of the language, not an afterthought.
Quoted jq where you need it
Anything the stages do not cover goes in a quoted jq expression as the last stage. Inside the quotes, jq’s own keywords are available.
Bounded pages
Answers come in pages bounded by rows and bytes. Every page of one query is read at the version the first page saw, so a long answer stays consistent while the branch moves.