Depends on how many cards you have, in general you can use:
> MATCH (card1:Card)-[r:DECK_INCIDENCE]-(card2:Card)
where card1.name in {cardsA} and card2.name in {cardsB}
> RETURN r;
Michael
Am 05.02.2014 um 15:05 schrieb Ben Titmarsh <[email protected]>:
> Hi All,
>
> I'd like your help with a bit of Cypher that I am trying to write.
>
> I have two lists of Strings containing the name property of some of the nodes
> in my graph. For example:
>
> fromNodes: ["cardA","cardB"..."cardZ"]
>
> toNodes: ["card1","card2"..."card50"]
>
> I would like to run a query to find all of the relationships of type
> 'DECK_INCIDENCE' that exist between the nodes defined in fromNodes and
> toNodes, i.e. for each node in fromNodes the query should return 50
> relationships (assuming that there is a relationship between all nodes) * 26
> nodes in fromNodes = 1300 relationships.
>
> I'm relatively new to Cypher, but have been using the following to retrieve
> one relationship between two specific nodes:
>
> MATCH (card1:Card {name:"cardA"})-[r:DECK_INCIDENCE]-(card2:Card
> {name:"card13"}) RETURN r;
>
> How can I extend this to return all of the relationships that I need without
> having to run 1300 queries?!
>
> Thanks!
>
> --
> 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/groups/opt_out.
--
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/groups/opt_out.