0
votes

I have 3 types of nodes in my graph. i.e database(Yellow), table (red) and column(sky blue).

  • Database and tables are connected with HAS_TABLE relationship.
  • Table and columns are connected with HAS_COLUMNS relationship.
  • Databases are interconnected with LINKED_TO relationship.

Database and tables are connected with HAS_TABLE relationship.

I want to display all table and column nodes of particular databas. How can I get using node id.

I am trying cypher something like this. But its returnng all connected nodes

MATCH (n:db)<-[*]-(d) WHERE ID(n) = 113 RETURN d
1

1 Answers

2
votes

To avoid the relationship types you do not want (i.e., LINKED_TO), you need to specify the relationship types you want do want:

MATCH (n:db)<-[:HAS_TABLE|HAS_COLUMN*]-(d)
WHERE ID(n) = 113
RETURN d