ablative docs
↑↓ move↵ openesc close
Stack Notebook ablative.com.au

Reading records in

The stages that bring records into a pipeline, and the shape that chooses fields.

Open .md

A collection by name

collection source

Read records from the named collection, including names that cannot be written bare.

  • name a 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
  • binding distinct 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.

  • fields bare names with nested selection sets
  • source one 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.