The following examples run against this graph:

Returns the number of edges in a path.
| Syntax | path_length(<pathVar>) | ||
| Arguments | Name | Type | Description |
<pathVar> | PATH | Path variable reference | |
| Return Type | UINT | ||
GQLMATCH p = ()->{1,3}() RETURN p, PATH_LENGTH(p) AS length
Result:
| p | length |
|---|---|
![]() | 2 |
![]() | 1 |
![]() | 1 |
Collects edges in a path into a list.
| Syntax | pedges(<pathVar>) | ||
| Arguments | Name | Type | Description |
<pathVar> | PATH | Path variable reference | |
| Return Type | LIST | ||
GQLMATCH p = ({_id: "P1"})-[]->{1,2}() RETURN pedges(p)
Result:
| pedges(p) |
|---|
| [{"from":"P1","to":"P2","uuid":"1","from_uuid":"8791028671650463745","to_uuid":"8718971077612535810","schema":"Cites","values":{"weight":2}}] |
| [{"from":"P1","to":"P2","uuid":"1","from_uuid":"8791028671650463745","to_uuid":"8718971077612535810","schema":"Cites","values":{"weight":2}},{"from":"P2","to":"P3","uuid":"2","from_uuid":"8718971077612535810","to_uuid":"12033620403357220867","schema":"Cites","values":{"weight":1}}] |
Collects the _uuid values of edges in a path into a list.
| Syntax | pedgeUuids(<pathAlias>) | ||
| Arguments | Name | Type | Description |
<pathAlias> | PATH | Path alias reference | |
| Return Type | LIST | ||
GQLMATCH p = ({_id: "P1"})-[]->{1,2}() RETURN pedgeUuids(p)
Result:
| pedgeUuids(p) |
|---|
| ["1"] |
| ["1","2"] |
Collects nodes in a path into a list.
| Syntax | pnodes(<pathVar>) | ||
| Arguments | Name | Type | Description |
<pathVar> | PATH | Path variable reference | |
| Return Type | LIST | ||
GQLMATCH p = ({_id: "P1"})-[]->{1,2}() RETURN pnodes(p)
Result:
| pnodes(p) |
|---|
| [{"id":"P1","uuid":"8791028671650463745","schema":"Paper","values":{"author":"Alex","title":"Efficient Graph Search","score":6}},{"id":"P2","uuid":"8718971077612535810","schema":"Paper","values":{"author":"Alex","title":"Optimizing Queries","score":9}}] |
| [{"id":"P1","uuid":"8791028671650463745","schema":"Paper","values":{"author":"Alex","title":"Efficient Graph Search","score":6}},{"id":"P2","uuid":"8718971077612535810","schema":"Paper","values":{"author":"Alex","title":"Optimizing Queries","score":9}},{"id":"P3","uuid":"12033620403357220867","schema":"Paper","values":{"author":"Zack","title":"Path Patterns","score":7}}] |
Collects the _id values of nodes in a path into a list.
| Syntax | pnodeIds(<pathAlias>) | ||
| Arguments | Name | Type | Description |
<pathAlias> | PATH | Path alias reference | |
| Return Type | LIST | ||
GQLMATCH p = ({_id: "P1"})-[]->{1,2}() RETURN pnodeIds(p)
Result:
| pnodeIds(p) |
|---|
| ["P1","P2"] |
| ["P1","P2","P3"] |