apoc.node.degree.out
Syntax |
|
||
Description |
Returns the total number of outgoing |
||
Arguments |
Name |
Type |
Description |
|
|
The node for which to count the total number of outgoing relationships. |
|
|
|
The relationship type to restrict the count to. The default is: ``. |
|
Returns |
|
Usage Examples
The examples in this section are based on the following sample graph:
MERGE (michael:Person {name: "Michael"})
WITH michael
CALL {
WITH michael
UNWIND range(0, 100) AS id
MERGE (p:Person {name: "Person" + id})
MERGE (michael)-[:KNOWS]-(p)
RETURN count(*) AS friends
}
CALL {
WITH michael
UNWIND range(0, 50) AS id
MERGE (p:Person {name: "Person" + id})
MERGE (michael)-[:FOLLOWS]-(p)
RETURN count(*) AS follows
}
RETURN friends, follows;
friends | follows |
---|---|
101 |
51 |
MATCH (p:Person {name: "Person1"})
RETURN apoc.node.degree.out(p) AS output;
output |
---|
0 |
MATCH (p:Person {name: "Michael"})
RETURN apoc.node.degree.out(p) AS output;
output |
---|
152 |
MATCH (p:Person {name: "Michael"})
RETURN apoc.node.degree.out(p, "KNOWS") AS output;
output |
---|
101 |