Hi everyone
How can I write a function in neo4j that takes each person's name as input and output that person's relationships with other people in different files?
Hi everyone
How can I write a function in neo4j that takes each person's name as input and output that person's relationships with other people in different files?
Can you clarify your requirements so we can help?
In the meantime, the following cypher will get all the people a person knows, where the people are provided in a list. Maybe this helps getting you started.
with ['John', 'Sally', 'Paul'] as names
unwind names as name
match (n:Person{name:name})-[:KNOWS]->(m)
return n as person, collect(m) as knows
Test Data:
Result: