A collection by name
collection source Read records from the named collection, including names that cannot be written bare.
-
namea nonempty collection name in double quotes
collection("patients") match source Match a labelled collection or a fixed chain of directed relations first or immediately after its collection.
-
nodes(binding:collection) or up to eight labelled nodes joined by directed relations -
bindingdistinct names matching [a-z_][a-z0-9_]* -
relation-[:kind]-> or <-[:kind]- at each of up to seven hops
match (p:patients)
match (c:patients)-[:admitted_to]->(w:wards)<-[:staffed_by]-(n:nurses) A bare name with filters
A collection whose name is lowercase letters, digits and underscores can be written bare. In parentheses, field: value pairs keep only matching records. Join several with and.
Each named collection must exist at the selected version. The patients collection comes from the first-records guide; wards and nurses are created in Relations and the graph. A notes example needs a notes collection of its own.
patients(ward: "4B")
patients(ward: "4B" and admitted: 20260912)
The shape
{ } shape Keep selected fields in record order; a first-stage shape reads collections in root order before worker Input.
-
fieldsbare names with nested selection sets -
sourceone or several collection roots in a first-stage shape
collection("patients") | { name ward }
{ patients(ward: "3A") { name } wards { code } } What comes next
A source may be followed by any searching or finishing stage, or by a quoted jq stage.