I know how to count the nodes and relationships in the graph. What about properties? Is this the correct answer?
match (n)
unwind keys(n) as key
return count(*)
GraphAcademy
CUP
Learn graphs.
Score for your country.
Represent your country in the GraphAcademy Cup.
Complete courses, earn points, and win weekly prizes.
I know how to count the nodes and relationships in the graph. What about properties? Is this the correct answer?
match (n)
unwind keys(n) as key
return count(*)
Yes this is the correct answer.
Reference
As noted in the reference; CALL db.schema.nodeTypeProperties() might be useful too.
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Count of properties | 3 | 4319 | June 19, 2019 | |
| Property keys | 2 | 410 | December 30, 2020 | |
| How do I count a node by the number of nodes with a specific property value | 7 | 2377 | July 6, 2020 | |
| Count nodes by property value | 2 | 556 | July 29, 2021 | |
| Summary of Node and Relationship Properties | 1 | 370 | January 4, 2022 |