apoc.nodes.isDense

This function only works on the store format block if the relationship type is specified. Otherwise it gives misleading results.

Details

Syntax

apoc.nodes.isDense(node)

Description

Returns true if the given NODE is a dense node.

Arguments

Name

Type

Description

node

NODE

The node to check for being dense or not.

realtionshipType

STRING

The type of the relationship to check the density of. The default is ''.

Returns

BOOLEAN

This function is restricted on on-premise instances. To use it, it must be unrestricted. For more details, see Installation → Load and unrestrict.

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
}
RETURN friends;
Results
friends

101

MATCH (p:Person {name: "Michael"})
RETURN apoc.nodes.isDense(p) AS output;
Results
output

true

MATCH (p:Person {name: "Michael"})
RETURN apoc.nodes.isDense(p, 'KNOWS') AS output;
Results
output

true

MATCH (p:Person {name: "Person1"})
RETURN apoc.nodes.isDense(p) AS output;
Results
output

false