0

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.

rickhg12hs
  • 10,638
  • 6
  • 24
  • 42
DatsunBing
  • 8,684
  • 17
  • 87
  • 172

3 Answers3

5

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
Tomaž Bratanič
  • 6,319
  • 2
  • 18
  • 31
3

I'm no expert, but isn't this one way to do it?

MATCH(n:Movie)
UNWIND keys(n) AS movie_keys
RETURN DISTINCT movie_keys
rickhg12hs
  • 10,638
  • 6
  • 24
  • 42
1
call db.schema.nodeTypeProperties()

from https://neo4j.com/docs/operations-manual/current/reference/procedures/

rictuar
  • 74
  • 6