Skip to content

Commit b524736

Browse files
committed
Explore non null properties for a given label
1 parent f7d55a0 commit b524736

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Explore non null node property counts for the selected node label. Variables: projection_node_label
2+
3+
MATCH (selectedNode)
4+
WHERE $projection_node_label IN labels(selectedNode)
5+
WITH *, keys(selectedNode) AS nodeProperties
6+
UNWIND nodeProperties AS nodeProperty
7+
WITH *
8+
ORDER BY nodeProperty
9+
WHERE selectedNode[nodeProperty] IS NOT NULL
10+
WITH nodeProperty, count(*) AS nonNullCount
11+
// RETURN nodeProperty, nonNullCount
12+
// ORDER BY nodeProperty, nonNullCount
13+
RETURN nonNullCount
14+
,count(DISTINCT nodeProperty) AS propertyCount
15+
,collect(nodeProperty) AS properties
16+
ORDER BY nonNullCount DESC

0 commit comments

Comments
 (0)