user697911
user697911

Reputation: 10531

How to return all nodes, properties and property values in a graph?

I want to do this in Java API. For each node, I want to return it's labels, properties, and the property values.

What's the best way to do this?

Upvotes: 2

Views: 796

Answers (2)

cybersam
cybersam

Reputation: 66967

Using the Java API, you can use the following methods on a Node instance:

Upvotes: 1

Bruno Peres
Bruno Peres

Reputation: 16355

This solution uses labels(), keys() and reduce() functions:

match(n)
return
    labels(n) as labels,
    keys(n) as properties,
    reduce(accumulator = [], key IN keys(n) | accumulator + n[key]) as values

Upvotes: 1

Related Questions