Cypher query question: How do I generate a table of all unwound property keys and property values for all nodes with the same label?


(Snellad1) #1

Hi,

I'd like to generate an exportable table of all property keys and their property values for all nodes with the same label.

For example I would like to unwind keys() , and then place the values of these in the next column.
Do I need to use extract? Reduce?

Many thanks.


(Bratanic Tomaz) #2

One way you could approach this is:

MATCH (l:Label)
UNWIND keys(l) as key
RETURN key,collect(distinct l[key])