Selectors Overview
Selectors are the composable query grammar for Context Nest. They let you precisely describe which documents you want — by tag, type, status, pack, node id, or any combination.
Quick reference
ctx query "#engineering" # By tag (tag:#engineering also works)
ctx query "type:document" # By type
ctx query "status:published" # By status
ctx query "pack:engineering-essentials" # By pack
ctx query "nodes/api-design" # One document, by node id
ctx query "#api +status:published" # AND (intersection)
ctx query "#api |#v2" # OR (union)
ctx query "#engineering -#deprecated" # NOT (exclude)
ctx query "(#api |#sdk) +status:published" # Grouped
Grammar
A selector expression is composed of atoms combined with operators:
- Atoms — a tag, a type, a status, a pack, a document title (
[[Title]]), a scope, or a node id. - Operators —
+(AND),|(OR),-(NOT). - Grouping — parentheses
( ).
The old & operator is not valid. ctx rejects it with INVALID_SELECTOR. There is no path: glob atom, and transport: and server: are not query atoms (they describe how a source node connects, not how you select it).
See Atoms and Operators for the full reference.
Related pages
- Selector OperatorsOperators combine atoms into compound expressions. Parentheses control evaluation order. Use them whenever you mix operators, rather than relying on…
- Selector ExamplesReal-world selector patterns for common use cases.
- Context Nest SpecificationThe Context Nest Specification is the canonical reference for the protocol. It defines the complete format, rules, and behavior that implementations must…
- Core ConceptsContext Nest is built on a small set of composable concepts. Understanding these gives you the full picture of how vaults work.
- Selector AtomsAtoms are the building blocks of selector expressions. Each atom matches documents based on a single criterion.