Search code examples
neo4jcypherneo4j-apoc

Neo4j: How to find all property names for a given node label


In neo4j, is there a way to get the names of all properties for a given node label. There are plenty of articles explaining how to do this for a given node, but I need to get all property names for all nodes that belong to a give label.


Solution

  • You might want to use a sample of 1000 nodes if you have a big graph, as checking millions and millions of nodes might take time.

    MATCH (n:Node)
    WITH n LIMIT 1000
    UNWIND keys(n) as key
    RETURN distinct key