Permalink
Browse files

Use dubious magic to make more than one relationship slurp work

  • Loading branch information...
1 parent 86bd0dc commit 85c2405fea5e7c1d202a3e0f5c68df66058b70d5 @mikesname committed Jul 2, 2012
Showing with 4 additions and 6 deletions.
  1. +4 −6 app/neo4j/gremlin.groovy
View
@@ -285,12 +285,10 @@ def query_exact_index_with_related(index_name, key, query_string, outRels, inRel
pipe = g.idx(index_name).get(key, Neo4jTokens.QUERY_HEADER + query_string)
if (outRels.size == 0 && inRels.size == 0)
return pipe
- pipe = pipe._()
- for (outr in outRels)
- pipe = pipe.copySplit(_(), _().out(outr))
- for (inr in inRels)
- pipe = pipe.copySplit(_(), _().in(inr))
- return pipe.exhaustMerge()
+ return pipe._().copySplit(*(
+ [_()] + outRels.collect{_().out(it)} + inRels.collect{_().in(it)}
+ )
+ ).exhaustMerge()
}
// Metadata

0 comments on commit 85c2405

Please sign in to comment.