Return certain properties from apoc.convert.toTree

Ah ok, its possible that this will do it:

nodes: map of list, a key is the name of the label, value is a list of properties that can be included or excluded. e.g nodes:{LABEL:<[prop1, prop2]/[-prop1, -prop2]>}

github changeset

So:

MATCH r=(p:Plaza)-[:in_plaza]->(rs:Restaurant)
WITH COLLECT(r) AS rs
CALL apoc.convert.toTree(rs, {
    nodes: {Plaza: ['name'], Restaurant: ['name']}
}) yield value
RETURN value

might do it :slight_smile: no promises!

2 Likes