4
votes

Cypher has got support for OR(|) in match relationship I want something like this Cypher query= ' start n= node:node_auto_index(name=ashish '') MATCH n-[?: f&:t]-> k return k '

Cypher supports this one n-[?:f|:t]->k for 2 relation its like this
G -[:f]->k <-[:t]-H
But what about mote than 2 relationships? Say 3,4 etc

2

2 Answers

4
votes

You could seperate a couple of match statements like this:

MATCH n-[:A_REL_TYPE*]-end, n-[:ANOTHER_REL_TYPE*]-end
4
votes

You just list them as separate MATCH elements

start n=node:node_auto_index(name='ashish') 
MATCH n-[:f]-> k, n-[:t]-> k, n-[:g]-> k
return k