apoc.schema.properties.distinctCount

Procedure APOC Core

apoc.schema.properties.distinctCount([label], [key]) YIELD label, key, value, count - quickly returns all distinct values and counts for a 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