MATCH (a:A {a:"a"}) WITH collect(a) as nodes
MATCH (b:B {b:"b"}) WITH collect(b) + nodes as nodes
MATCH (c:C {c:"c"}) WITH collect(c) + nodes as nodes
UNWIND nodes as n
MATCH (n)-[rel:X|Y|Z]->(m)
WHERE n IN nodes
RETURN n, rel, m


On Thu, May 4, 2017 at 7:33 PM, Kamal Murthy <[email protected]> wrote:

> Hi Simone,
>
>
> Here is the query that worked for me:
>
>
> MATCH (c)-[]->(n)-[]->(p:Cusine)
> WHERE p.name = "Mexican"
> WITH DISTINCT n
>
> MATCH (c)-[]->(n1)-[]->(p:Features)
> WHERE n1.id = n.id and p.price = "medium"
> WITH DISTINCT n1
>
> MATCH PATH = (c)-[]-(n1)-[r:FEATURES|CUISINE]->(n3)
> RETURN PATH;
>
> -Kamal
>
>
> On Thursday, May 4, 2017 at 1:14:57 AM UTC-7, Simone Z wrote:
>>
>> Dear All,
>> I am a novice in Cypher and I would greatly appreciate some help with a
>> query.
>>
>> In my database I have several nodes labels (A, B, C...) and relationship
>> types (X, Y , Z).
>>
>> I would like to get a subset of the database, where nodes A respect
>> condition a, nodes B condition b and nodes C condition c, and get any edge
>> of type X, Y or Z connecting any selected node.
>>
>> How would the query look like?
>>
>> Thank you!
>>
>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to