Search code examples
cypherdirected-graphredisgraph

How to get children of a node in redisgraph?


This is a directed unweighted graph

I created this directed unweighted graph in redisgraph but at the time of traversing I am not able to fetch the children of A. Is there any command in redisgraph to get the children of A? Since the graph is fully dynamic, I don't know the exact nature of children of A. After getting the list of children I can match their property and fetch perfect node.


Solution

  • The node 'A' needs to be identified somehow, e.g. an attribute.

    Using the Cypher query language one can get A's children by issuing the query:

    MATCH (A {id:'a'})-[]->(X) RETURN X

    Assuming 'A' has an attribute 'id' with the value 'a' than X represent all of A's direct neighbours.