diff --git a/core/src/main/java/apoc/meta/Meta.java b/core/src/main/java/apoc/meta/Meta.java index f94ccd8206..98399cf515 100644 --- a/core/src/main/java/apoc/meta/Meta.java +++ b/core/src/main/java/apoc/meta/Meta.java @@ -58,6 +58,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.TreeMap; import java.util.concurrent.ThreadLocalRandom; @@ -372,6 +373,52 @@ public Stream stats() { return Stream.of(collectStats()); } + @UserFunction(name = "apoc.meta.nodes.count") + @Description("apoc.meta.nodes.count([labels], $config) - Returns the sum of the nodes with a label present in the list.") + public long count(@Name(value = "nodes", defaultValue = "[]") List nodes, @Name(value = "config", defaultValue = "{}") Map config) { + MetaConfig conf = new MetaConfig(config); + final DatabaseSubGraph subGraph = new DatabaseSubGraph(transaction); + Stream