Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-24-2022 10:49 PM
Hi,
When I run the querry like MATCH (a) RETURN a
the result (all node properties) is in one column/string.
I know that I can write RETURN a.prop1, a.prop2,.... to have properties in each column. But I look for a universal solution like if I do not know which properties one node has.
How is possible to split the query result (string) in multiple columns?
Regards and thank you
03-04-2022 07:24 AM
AFAIK, currently there is no way to do something like that without specify explicitly the columns,
see cypher - How to return all the properties in Neo4j to be in diffrent columns - Stack Overflow and Dynamic result columns using Neo4j Cypher - Stack Overflow.
Anyway, I don't know if is useful for your use case,
but maybe you could split the result in rows instead of columns, for example:
MATCH (a)
WITH properties(a) as props
UNWIND keys(props) as propKey
RETURN propKey, props[propKey] as propValue
For example with this node, create (n:Test {a: 1, b: 2})
,
I get:
propKey | propValue
"a" | 1
"b" | 2
03-06-2022 10:01 PM
Sorry but this is not the case for me .... I need columns.
Anyway thank you for your answer it is also useful I learned something new
All the sessions of the conference are now available online