On 12/8/11 17:19 , Andres Taylor wrote:
>> I'm guessing something like this:
>> start ou=node(1234)
>> match (ou)-[:CHILD_OU*..100]->(child_ou)<-[:OWNER]-(case)
>> where case.status = "CLOSED"
>> return avg(case.completionTime)
>>
>> Question is, will the OU itself be included? Or does this imply that
>> there *has* to be a child-OU?
>
>
> That query does imply that there has to be a child-OU. The minimal length
> for a path where you haven't specified anything manually is one. You can be
> explicit about the fact that children are not needed by saying that min
> length of the path is
> zero<http://docs.neo4j.org/chunked/snapshot/query-match.html#match-zero-length-paths>.

Ok, so with:
 >> start ou=node(1234)
 >> match (ou)-[:CHILD_OU*0..100]->(child_ou)<-[:OWNER]-(case)
 >> where case.status = "CLOSED"
 >> return avg(case.completionTime)

that would give me what I want?

Cool! Especially considering that this was A LOT OF WORK to do with 
MySQL (current solution), as I had to implemented nested set models and 
whatnot. If it is as easy as the above, oh man...

/Rickard
_______________________________________________
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to