Guide
Every traversal starts from a source. Choose the narrowest source that matches the
data you already know.
Source choices
An ID list returns nodes in the given order and skips missing IDs. An ID parameter is
one non-negative integer ID or an array of them, typed (
i64, { "array": "i64" }) or
untyped. Any other value fails the query.
Source predicates are eligible for index push-down. Secondary indexes are defined per
label, so a source must be scoped to a label to read one: nWithLabelWhere /
n_with_label_where, or a .where(...) directly after nWithLabel. A source predicate
without a label scans every node. A .where(...) later in a traversal filters the
current stream.
Read active users
Read by indexed property
Scope the source predicate to the indexed label, so the property read uses its index:Read an earlier result
UseNodeRef.var("user") (or the equivalent SDK reference) as the source of a later
entry. Named references are transaction-local; they do not create stored variables or
routes.
Results without a projection
An entry without a projection, such asg().nWithLabel("User").limit(25), returns one
{"$id": ...} per node or edge (plus $distance or $score after a search) and no
properties. To read properties, end with valueMap, project, or another
projection.
Next steps
Traverse relationships
Follow outgoing and incoming edges.
Filtering
Narrow the current stream with predicates.
Ordering and pagination
Sort the stream and return it one page at a time.