apoc.nodes.rels

Details

Syntax

apoc.nodes.rels(rels) :: (rel)

Description

Returns all RELATIONSHIP values with the given ids.

Input arguments

Name

Type

Description

rels

ANY

The relationships to be returned. Relationships can be of type STRING (elementId()), INTEGER (id()), RELATIONSHIP, or `LIST<STRING | INTEGER | RELATIONSHIP>

Return arguments

Name

Type

Description

rel

RELATIONSHIP

A relationship.

Usage Examples

The examples in this section are based on the following sample graph:

CREATE (Keanu:Person {name:'Keanu Reeves', born:1964})
CREATE (TheMatrix:Movie {title:'The Matrix', released:1999, tagline:'Welcome to the Real World'})
CREATE (Keanu)-[:ACTED_IN {roles:['Neo']}]->(TheMatrix);

We can return the internal IDs of these nodes using the id function:

MATCH ()-[r]->()
RETURN id(r) AS id;
Results
id

499367

CALL apoc.nodes.rels([499367]);
Results
rel

[:ACTED_IN {roles: ["Neo"]}]