Reputation: 85
I'm having a small issue finding out how to return one node, that has multiple outgoing relations.
So what I want is to display only node, even if it has more than one relation; this is my query:
MATCH total=(n:Employee)-[r:WorkedOn]->(p:Project)
RETURN toFloat(p.total_efficiency) / toFloat(count(p)) as score , n.first_name as name, n.last_name as surname, r.role as role, n.start_date_of_work as startDate, n.experience as experience,
n.email as email, n.age as age, collect(p.name) as projects ORDER BY score DESC LIMIT {l}
but this returns a table like this:
How do I solve the double 'Jari Van Melckebeke' records? I only want one.
I could also remove the 'role' property, but I need the Project object anyway to calculate the score...
Thanks in advance, Jari Van Melckebeke
Upvotes: 1
Views: 384
Reputation: 30417
You have two options to collapse this into one row. Either, as you suggested, removing role from your return, or returning COLLECT(r.role) as roles
.
Upvotes: 1