Hello Community,
I'm using Neo4j 4.1 and neo4j-driver
for nodeJS.
My data looks like this:
where INVITED_BY has a property 'wid' that indicates to what workspace a user invited another.
I'm using a frontend library to show nodes, and I'm working with all Cypher queries that returns paths, like:
match path=(n:Workspace)-[]-()
where n.wid = '${nodeId}'
return path
limit 50`
This time I need to show top 'inviters', and show people invited by them, but limited to a few nodes.
I found this very useful link:
But I'm unable to adapt it to my model AND STILL return a path, instead of just the nodes.
If I run this query on Neo4j browser, it looks great:
match (promoter:Member)<-[r:INVITED_BY]-(invited:Member)
match (invited)-[r]->(promoter)
return promoter, collect(invited)[..5]
but the actual data returned (under table or text tab, or even just running the query with NodeJS driver) doesn't have the relationships.
I tried this, but it after I collect the nodes, I have a list, and isn't assignable to a node. And I'm stuck
match (promoter:Member)<-[r:INVITED_BY]-(invited:Member)
match path=(invited)-[r]->(promoter)
with collect(invited)[..5] as invi
match path2=(invi)-[r]->(promoter)
return path2
I just need to limit the invited nodes but still return a path.
Any help will be appreciated.