apoc.schema.properties.distinctCount

This procedure is not considered safe to run from multiple threads. It is therefore not supported by the parallel runtime (introduced in Neo4j 5.13). For more information, see the Cypher Manual → Parallel runtime.

Details

Syntax

apoc.schema.properties.distinctCount([ label, key ]) :: (label, key, value, count)

Description

Returns all distinct property values and counts for the given key.

Input arguments

Name

Type

Description

label

STRING

The node label to count distinct properties on. The default is: ``.

key

STRING

The name of the property to count distinct values of. The default is: ``.

Return arguments

Name

Type

Description

label

STRING

The label of the node.

key

STRING

The name of the property key.

value

ANY

The distinct value.

count

INTEGER

The number of occurrences of the value.

Usage Examples

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

CREATE (:Person {name: "Michael"});
CREATE (:Person {name: "Ryan"});
CALL apoc.schema.properties.distinctCount("Person", "name");
Results
label key value count

"Person"

"name"

"Michael"

1

"Person"

"name"

"Ryan"

1