apoc.schema.properties.distinctCount

Procedure

apoc.schema.properties.distinctCount(label String, key String) - returns all distinct property values and counts for the given key.

Signature

apoc.schema.properties.distinctCount(label =  :: STRING?, key =  :: STRING?) :: (label :: STRING?, key :: STRING?, value :: ANY?, count :: INTEGER?)

Input parameters

Name Type Default

label

STRING?

key

STRING?

Output parameters

Name Type

label

STRING?

key

STRING?

value

ANY?

count

INTEGER?

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");
Table 1. Results
label key value count

"Person"

"name"

"Michael"

1

"Person"

"name"

"Ryan"

1