Condition Based Output

As you see in image, A is connected to B,C,F,G. When I query A like "Match (n:Label{Name:'Name'})", it's actually returning me B,C,F,G which is right, but I want "B" to be returned only if I query "A","D","E", like if the values of A,D,E are true.

Here D, E could be connected to something else, but when the values of A,D and E are true only then B should be given. Can I achieve that?

Hello @vence.andersen17 :slight_smile:

Did you have a look at CASE expression and APOC conditional cypher execution?

Regards,
Cobra

Yeah, but what I am trying here is, when I query "A" like "Match (n:label{Name:'A'}) return n", I need the output to show only A and when I expand it's nodes I need to get only "C","F" and "G". Is that possible?

Like "B" should be given only when I query "A","D" and "E" at the same time.