I have a graph database in ne04j where the nodes are connected to each other based on a directed relation(knows).
A->B
A->C
A->E
etc.
The nodes are indexed based on the user ID so I can find any node. No problem with that.
The question is how to find all the nodes that are linked to node A. I guess it has something to do with outgoing relationship but I dont know how to actually implement it. I am new to neo4j though i understand the graph concepts involved. I am using Everyman neo4j php graph api.
Do I need to index the relationship as well to achieve what I am trying to do or is it possible via a function to get all the connected nodes?
Thanks!
In Neo4jPHP you can do:
This is more performant than Cypher if all you want to do is retrieve the nodes. Use Cypher if you need to do more complicated path matching.
More information here: https://github.com/jadell/neo4jphp/wiki/Nodes-and-Relationships under the section “Retrieve Relationships from a Node”