apoc.get.rels

Procedure

apoc.get.rels(rels Any) - returns all relationships with the given ids.

Signature

apoc.get.rels(relationships :: ANY?) :: (rel :: RELATIONSHIP?)

Input parameters

Name Type Default

relationships

ANY?

null

Output parameters

Name Type

rel

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;
Table 1. Results
id

0

CALL apoc.get.rels([0]);
Table 2. Results
rel

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