4

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

ashupon
  • 77
  • 8

2 Answers2

4

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
Michael Hunger
  • 41,339
  • 3
  • 57
  • 80
4

You could seperate a couple of match statements like this:

MATCH n-[:A_REL_TYPE*]-end, n-[:ANOTHER_REL_TYPE*]-end
tstorms
  • 4,941
  • 1
  • 25
  • 47