---
title: nodes
url: https://nexyron.tech/docs/cypher/functions/path/nodes
description: Inspects a path value returned by a Cypher path pattern or path function. It is documented separately because path valued results carry ordered topology that is different from a fl
---

# nodes

## Generic Description

Inspects a path value returned by a Cypher path pattern or path function. It is documented separately because path-valued results carry ordered topology that is different from a flat row of nodes or relationships.

Simple example:

```cypher
MATCH p = (:Page)-[:LINK]->(:Page) RETURN nodes(p), edges(p)
```

## Consumer-Level Explanation

Use it when the path object needs to be decomposed into nodes, relationships, or structural quality checks. Prefer this function when the query needs to inspect path structure after matching, ranking, or filtering candidate traversals.

## More Detailed Explanation

`nodes` should be understood by the value shape it expects and the row shape it returns. It composes with `MATCH`, `WHERE`, `WITH`, `RETURN`, and procedure output, so planner-facing documentation should describe both the immediate value transformation and why it belongs in the database query.

## Advanced Example

This example uses `nodes` inside a named row pipeline so the value shape is clear to both the planner and reviewers.

```cypher
MATCH p = (:Page)-[:LINK*1..2]->(:Page)
RETURN nodes(p) AS focused_value, size(nodes(p)) AS node_count
LIMIT 10
```

## Real Use Cases

-   keeping value shaping visible to the planner and reviewers
-   combining graph structure with document-style payload handling
-   returning named, typed fields that downstream tooling can reason about

## Real Limitations And Tradeoffs

-   the function does not repair incorrectly modeled input values
-   nearby aliases may be clearer if they express the business intent more directly
-   broad use inside hot filters should be reviewed for cost and index interaction
