apoc.algo.cover

Procedure APOC Core

apoc.algo.cover(nodes) yield rel - returns all relationships between this set of nodes

Signature

apoc.algo.cover(nodes :: ANY?) :: (rel :: RELATIONSHIP?)

Input parameters

Name Type Default

nodes

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 (Carrie:Person {name:'Carrie-Anne Moss', born:1967})
CREATE (TomH:Person {name:'Tom Hanks', born:1956})

CREATE (Keanu)-[:KNOWS]->(Carrie);
CREATE (Tom)-[:KNOWS]->(Carrie);
match (p:Person)
WHERE p.name IN ["Keanu Reeves", "Carrie-Anne Moss"]
with collect(id(p)) as nodes
CALL apoc.algo.cover(nodes)
YIELD rel
RETURN  startNode(rel), rel, endNode(rel);
Table 1. Results
startNode(rel) rel endNode(rel)

(:Person {name: "Keanu Reeves", born: 1964})

[:KNOWS]

(:Person {name: "Carrie-Anne Moss", born: 1967})