1..1 => leave it off that's the default.

> MATCH (a)
> OPTIONAL MATCH (a) -[:WROTE]-> (b)
> OPTIONAL MATCH (a) -[:DIRECTED]-> (c)
> RETURN a, b, c

In the browser it works with the 4 optional matches.


Michael


Am 05.02.2014 um 17:31 schrieb Bytor99999 <[email protected]>:

> Now I also tried this
> 
> MATCH (n:Person)
> OPTIONAL MATCH (n) -[:PRODUCED*1..1]-> (produced)
> OPTIONAL MATCH (n) -[:ACTED_IN*1..1]-> (acted)
> OPTIONAL MATCH (n) -[:WROTE*1..1]-> (wrote)
> OPTIONAL MATCH (n) -[:DIRECTED*1..1]-> (directed)
> RETURN n.name, acted, produced, wrote, directed
> 
> And whatever is the last OPTIONAL MATCH doesn't seem to work. Maybe it is in 
> the online class tool that makes it not work. And it happens when there are 
> 4, when there are 3 optional matches it still works on all of the 
> relationships.
> 
> Thanks
> 
> Mark
> 
> On Wednesday, February 5, 2014 8:17:04 AM UTC-8, Bytor99999 wrote:
> I think I got the general approach I need. I used the Movie database to test 
> it out and this worked
> 
> MATCH (a)
> OPTIONAL MATCH (a) -[:WROTE*1..1]-> (b)
> OPTIONAL MATCH (a) -[:DIRECTED*1..1]-> (c)
> RETURN a, b, c
> 
> Obviously I just have to add the top portion from my query and use OPTIONAL 
> MATCH to make sure I get the player and all the relationships that have 
> relationships to other nodes even if one or two relationships don't exist.
> 
> Mark
> 
> -- 
> 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.

Reply via email to