Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to have match multiple relationships in cypher

Tags:

php

neo4j

cypher

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

like image 974
ashupon Avatar asked Feb 18 '23 00:02

ashupon


1 Answers

You could seperate a couple of match statements like this:

MATCH n-[:A_REL_TYPE*]-end, n-[:ANOTHER_REL_TYPE*]-end
like image 99
tstorms Avatar answered Feb 24 '23 08:02

tstorms