Search code examples
memgraphdb

What is the Cypher query on Expand action in Memgraph Lab?


I'm using Memgraph Lab. Once the visualization of graph is done I know that I can expand individual nodes.

enter image description here

What is the exact Cypher query that gets executed?


Solution

  • This is the exact Cypher query that gets executed on expand:

    MATCH (n)-[r]->(m) WHERE id(n) = $id OR id(m) = $id RETURN n, r, m;
    

    The property $id should be the internal Memgraph id of the node that is being expanded. If there are any other unique property, they can also be used, e.g. WHERE n.my_prop = $my_prop_value.