pub struct CollectSpec {
pub alias: String,
pub rel_type: Option<String>,
pub direction: Direction,
pub target_labels: Vec<String>,
pub steps: Vec<TraversalStep>,
pub fields: Vec<(String, String)>,
pub nested: Vec<CollectSpec>,
pub filter: Option<Expr>,
pub order_by: Vec<(String, bool)>,
pub unique: bool,
pub skip: u64,
pub limit: Option<u64>,
}Expand description
$collect at the root binding grain (document 19): one declared step
per level, batched typed-adjacency collection, optional uniqueness and
local slice. Output attaches to each returned record under alias.
Two forms: alias-based (from in the docs) resolves rel_type/
direction/target_labels from the matching where traversal alias, and
projects whole records unless fields is set; label-based (label in
the docs) traverses inline (direction defaults to outgoing), supports a
where filter, an output-key→field projection map, and nested collects
evaluated recursively on each collected record (hierarchical output).
Fields§
§alias: StringOutput key the collected array is attached under.
rel_type: Option<String>Relationship type filter for direct-adjacency collects.
direction: DirectionEdge direction for direct-adjacency collects.
target_labels: Vec<String>Labels a collected record must carry (empty = any label).
steps: Vec<TraversalStep>Alias-based (from) collects carry the full traversal path to the
alias, including each level’s where predicates. Empty for
label-based collects (direct adjacency).
fields: Vec<(String, String)>(output_key, source_field) projection; empty = whole record.
nested: Vec<CollectSpec>Nested (hierarchical) collects evaluated on each collected record.
filter: Option<Expr>where filter evaluated on each collected record (label-based).
order_by: Vec<(String, bool)>ORDER BY (field, desc) applied to the collected array.
unique: boolWhen true, deduplicate collected records by identity.
skip: u64Number of collected records to skip after ordering.
limit: Option<u64>Maximum number of collected records to return.